Web Application Firewall API¶
The WAF Service Class¶
The waf high-level interface is available through the waf
member of a Connection
object. The
waf
member will only be added if the
otcextensions.sdk.register_otc_extensions(conn)
method is called.
Certificate Operations¶
- class otcextensions.sdk.waf.v1._proxy.Proxy(session, *args, **kwargs)
- certificates(**query)
Retrieve a generator of certificates
- Parameters:
query (dict) – Optional query parameters to be sent to limit the resources being returned. * limit: pagination limit * offset: pagination offset
- Returns:
A generator of certificate
Certificate
instances
- create_certificate(**attrs)
Upload certificate from attributes
- Parameters:
attrs (dict) – Keyword arguments which will be used to create a
Certificate
, comprised of the properties on the Certificate class.- Returns:
The results of certificate creation
- Return type:
- get_certificate(certificate)
Get a certificate
- Parameters:
certificate – The value can be the ID of a certificate or a
Certificate
instance.- Returns:
Certificate instance
- Return type:
- delete_certificate(certificate, ignore_missing=True)
Delete a certificate
- Parameters:
certificate – The value can be the ID of a certificate or a
Certificate
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the certificate does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent certificate.
- Returns:
Certificate been deleted
- Return type:
- update_certificate(certificate, **attrs)
Update certificate attributes
- Parameters:
certificate – The id or an instance of
Certificate
attrs (dict) – attributes for update on
Certificate
- Return type:
- find_certificate(name_or_id, ignore_missing=True, **attrs)
Find a single certificate
- Parameters:
name_or_id – The name or ID of a certificate
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the certificate does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent certificate.
- Returns:
None
Domain Operations¶
- class otcextensions.sdk.waf.v1._proxy.Proxy(session, *args, **kwargs)
- domains(**query)
Retrieve a generator of domains
- Parameters:
query (dict) – Optional query parameters to be sent to limit the resources being returned. * limit: pagination limit * offset: pagination offset * name: domain name (hostname) * policy_name: policy name
- Returns:
A generator of domain
Domain
instances
- create_domain(**attrs)
Upload domain from attributes
- get_domain(domain)
Get a domain
- delete_domain(domain, ignore_missing=True)
Delete a domain
- Parameters:
domain – The value can be the ID of a domain or a
Domain
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the domain does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent domain.
- Returns:
Domain been deleted
- Return type:
- update_domain(domain, **attrs)
Update domain attributes
- find_domain(name_or_id, ignore_missing=True, **attrs)
Find a single domain
- Parameters:
name_or_id – The name or ID of a domain
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the domain does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent domain.
- Returns:
None
- find_domain(name_or_id, ignore_missing=True, **attrs)
Find a single domain
- Parameters:
name_or_id – The name or ID of a domain
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the domain does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent domain.
- Returns:
None