ApiGateway¶
Gateway Operations¶
- class otcextensions.sdk.apig.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- gateways(**attrs)
Query gateways
- Returns:
A generator of gateway object of a
Gateway
- create_gateway(**attrs)
Create gateway
- Returns:
A gateway object
- Return type:
Gateway
- wait_for_gateway(gateway, status='Running', failures=None, interval=2, wait=960)
Wait for specific gateway status :param gateway: key id or an instance of
Gateway
- Parameters:
status – Specific status of the gateway.
failures – Specific failure status of the gateway.
interval – Seconds between checking the gateway.
wait – Seconds between checking the gateway.
- %returns: instance of
- get_gateway(gateway)
Get details of specific gateway :param gateway: key id or an instance of
Gateway
- Returns:
instance of
Gateway
- update_gateway(gateway, **attrs)
Update an existing API Gateway.
- delete_gateway(gateway, **attrs)
Delete specific gateway :param gateway: key id or an instance of
Gateway
- Returns:
‘None’
- get_gateway_progress(gateway)
Get specific gateway progress :param gateway: key id or an instance of
Gateway
- %returns: instance of
- get_constraints(gateway)
Get gateway constraints
- Parameters:
gateway – key id or an instance of
Gateway
- %returns: instance of
- enable_public_access(gateway, **attrs)
Enable public access for a specific API Gateway.
- update_public_access(gateway, **attrs)
Update public access settings for a specific API Gateway.
- disable_public_access(gateway)
Disable public access for a specific API Gateway.
- modify_gateway_spec(gateway, **attrs)
Modify the specifications of a specific API Gateway.
- bind_eip(gateway, **attrs)
Bind an Elastic IP (EIP) to a specific API Gateway.
- unbind_eip(gateway)
Unbind an Elastic IP (EIP) from a specific API Gateway.
- enable_ingress(gateway, **attrs)
Enable public inbound access for a specific API Gateway.
This method binds a public IP to an API Gateway to allow public inbound traffic from the internet.
- update_ingress(gateway, **attrs)
Update public inbound access bandwidth of a specific API Gateway.
This method modifies the inbound bandwidth settings for an API Gateway that has public access enabled.
AZ Operations¶
- class otcextensions.sdk.apig.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- azs(**attrs)
Retrieve availability zones (AZs) for API Gateway service.
- Parameters:
attrs – Optional filters for querying availability zones.
- Returns:
A list of availability zones.
- Return type:
list of
AZ
Environment Operations¶
- class otcextensions.sdk.apig.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- create_environment(gateway, **attrs)
Create a new environment for a specific API Gateway.
This method creates an environment within the given API Gateway by associating it with the specified attributes.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional attributes for the environment creation.
- Returns:
An instance of
ApiEnvironment
- update_environment(gateway, environment, **attrs)
Update an existing environment for a specific API Gateway.
This method updates the specified environment within the API Gateway by applying the provided attributes.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
environment – The ID of the environment or an instance of
ApiEnvironment
attrs – Additional attributes to update the environment.
- Returns:
Updated instance of
ApiEnvironment
- delete_environment(gateway, environment, **attrs)
Delete an existing environment from a specific API Gateway.
This method removes the specified environment from the API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
environment – The ID of the environment or an instance of
ApiEnvironment
attrs – Additional attributes for the delete operation.
- Returns:
None
- environments(gateway, **attrs)
List all environments for a specific API Gateway.
This method retrieves a list of environments associated with the given API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional filters for listing environments.
- Returns:
A list of instances of
ApiEnvironment
Api Group Operations¶
- class otcextensions.sdk.apig.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- create_api_group(gateway, **attrs)
Create a new API group for a specific API Gateway.
This method creates an API group associated with the given API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional attributes for creating the API group.
- Returns:
An instance of
ApiGroup
- update_api_group(gateway, api_group, **attrs)
Update an existing API group for a specific API Gateway.
This method updates the attributes of an API group associated with the given API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
api_group – The ID of the API group or an instance of
ApiGroup
attrs – Additional attributes for updating the API group.
- Returns:
The updated instance of
ApiGroup
- delete_api_group(gateway, api_group, **attrs)
Delete an API group from a specific API Gateway.
This method deletes the specified API group associated with the given API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
api_group – The ID of the API group or an instance of
ApiGroup
attrs – Additional parameters for deleting the API group.
- Returns:
None
- get_api_group(gateway, api_group)
Retrieve details of a specific API group.
This method retrieves the details of an API group associated with the given API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
api_group – The ID of the API group or an instance of
ApiGroup
- Returns:
An instance of
ApiGroup
Environment Variables Operations¶
- class otcextensions.sdk.apig.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- create_environment_variable(gateway, **attrs)
Create a new environment variable for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional attributes for the environment variable creation.
- Returns:
An instance of ApiEnvironmentVar
- update_environment_variable(gateway, var, **attrs)
Update an existing environment variable for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
var – The ID of the environment var or an instance of ApiEnvironmentVar
attrs – Additional attributes to update the environment.
- Returns:
Updated instance of ApiEnvironmentVar
- delete_environment_variable(gateway, var, ignore_missing=False)
Delete an existing environment variable from a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
var – The ID of the environment or an instance of ApiEnvironmentVar
- Returns:
None
- environment_variables(gateway, **attrs)
List all environment vars for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional filters for listing environment vars.
- Returns:
A list of instances of ApiEnvironmentVar
- get_environment_variable(gateway, var)
Retrieve details of a specific environment variable.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
var – The ID of the variable or an instance of ApiEnvironmentVar
- Returns:
An instance of ApiEnvironmentVar
Throttling Policies Operations¶
- class otcextensions.sdk.apig.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- create_throttling_policy(gateway, **attrs)
Create a new throttling policy for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional attributes for the throttling policy creation.
- Returns:
An instance of ThrottlingPolicy
- update_throttling_policy(gateway, policy, **attrs)
Update an existing throttling policy for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
tp – The ID of the throttling policy or an instance of ThrottlingPolicy
attrs – Additional attributes to update the throttling policy.
- Returns:
Updated instance of ThrottlingPolicy
- delete_throttling_policy(gateway, policy, ignore_missing=False)
Delete an existing throttling policy from a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
policy – The ID of the throttling policy or an instance of ThrottlingPolicy
- Returns:
None
- throttling_policies(gateway, **attrs)
List all throttling policies for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional filters for listing throttling policies.
- Returns:
A list of instances of ThrottlingPolicy
- get_throttling_policy(gateway, policy)
Retrieve details of a specific throttling policy.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
policy – The ID of the throttling policy or an instance of ThrottlingPolicy
- Returns:
An instance of ThrottlingPolicy
Api Operations¶
- class otcextensions.sdk.apig.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- create_api(gateway, **attrs)
Create a new API for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional attributes for the Api creation.
- Returns:
An instance of Api
- update_api(gateway, api, **attrs)
Update an existing API for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
api – The ID of the Api or an instance of Api
attrs – Additional attributes to update the Api.
- Returns:
Updated instance of Api
- delete_api(gateway, api, ignore_missing=False)
Delete an existing API from a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
api – The ID of the Api or an instance of Api
- Returns:
None
- apis(gateway, **attrs)
List all APIs for a specific API Gateway.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
attrs – Additional filters for listing Api.
- Returns:
A list of instances of Api
- get_api(gateway, api)
Retrieve details of a specific API.
- Parameters:
gateway – The ID of the gateway or an instance of
Gateway
api – The ID of the Api or an instance of Api
- Returns:
An instance of Api