Anti_DDoS API

The Anti DDoS Service Class

The anti_ddos high-level interface is available through the anti_ddos member of a Connection object. The anti_ddos member will only be added if the otcextensions.sdk.register_otc_extensions(conn) method is called.

Floating IP Operations

class otcextensions.sdk.anti_ddos.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
floating_ips(**query)

Get the list of anti-ddos Floating IPs

Parameters

query (kwargs) – Optional query parameters to be sent to limit the resources being returned.

Returns

A generator of FloatingIP object

Return type

class:~otcextensions.sdk.anti_ddos.v1.floating_ip.FloatingIP

protect_floating_ip(floating_ip_id, **kwargs)

Enable anti-ddos on the given Floating IP

Parameters
  • floating_ip_id – The Floating IP id or an instance of FloatingIP

  • kwargs (dict) – Keyword arguments which will be used to create a FloatingIP

Return type

FloatingIP

unprotect_floating_ip(floating_ip, ignore_missing=True)

Diable anti-ddos on the given Floating IP

Parameters
  • floating_ip_id – The EIP id or an instance of FloatingIP

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the floating IP does not exist.

Return type

FloatingIP

get_floating_ip_policies(floating_ip)

Get detail about an Floating IP policy

Parameters

floating_ip – The Floating IP id or an instance of FloatingIP

Return type

FloatingIP

update_floating_ip_policies(floating_ip, **attrs)

Update Floating IP policy

Parameters
  • floating_ip – The Floating IP id or an instance of FloatingIP

  • attrs (dict) – attributes for update on FloatingIP

Return type

FloatingIP

get_floating_ip_status(floating_ip_id)

Get specific floating ip status by floating ip id.

Parameters

floating_ip_id – The floating ip id

Returns

The status of floating ip

Return type

FloatingIPStatus

floating_ip_events(floating_ip_id, **query)

List specific floating ip events by floating ip id.

Parameters
  • floating_ip_id – The floating ip id

  • query (dict) – Optional query parameters to be sent to limit the resources being returned.

Returns

A generator of FloatingIPLog object

Return type

FloatingIPLog

floating_ip_stat_day(floating_ip_id)

List statistic for last 24 hours by floating ip id.

Parameters

floating_ip_id – The floating ip id

Returns

A generator of FloatingIPDayStat object

Return type

FloatingIPDayStat

floating_ip_stat_week(**query)

List weekly defence statisticsabout all floating ips.

Parameters

query (dict) – Optional query parameters to be sent to limit the resources being returned: * period_start_date - start day of the 7 day period to query

Returns

A generator of FloatingIPWeekStat object

Return type

FloatingIPWeekStat

Misc Operations

class otcextensions.sdk.anti_ddos.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
configs(**kwargs)

Get Alarm configuration

Returns

one object of class Config