VPCEP API

The VPC Endpoint Class

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

Endpoint Operations

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

Return a generator of endpoints

Parameters:

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

Returns:

A generator of endpoint objects

Return type:

Endpoint

create_endpoint(**attrs)

Create a new endpoint from attributes

Parameters:

attrs (dict) – Keyword arguments which will be used to create a Endpoint, comprised of the properties on the Endpoint class.

Returns:

The results of endpoint creation

Return type:

Endpoint

get_endpoint(endpoint)

Get a single endpoint

Parameters:

endpoint – The value can be the ID of a endpoint or a Endpoint instance.

Returns:

One Endpoint

Raises:

ResourceNotFound when no resource can be found.

delete_endpoint(endpoint, ignore_missing=True)

Delete a endpoint

Parameters:
  • endpoint – The value can be either the ID of a endpoint or a Endpoint instance.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the endpoint does not exist. When set to True, no exception will be set when attempting to delete a nonexistent endpoint.

Returns:

None

Service Operations

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

Return a generator of endpoint services

Parameters:

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

Returns:

A generator of endpoint service objects

Return type:

Service

create_service(**attrs)

Create a new endpoint service from attributes

Parameters:

attrs (dict) – Keyword arguments which will be used to create a Service, comprised of the properties on the Service class.

Returns:

The results of endpoint service creation

Return type:

Service

get_service(service)

Get a single endpoint service

Parameters:

service – The value can be the ID of a endpoint service or a Service instance.

Returns:

One Service

Raises:

ResourceNotFound when no resource can be found.

find_service(name_or_id, ignore_missing=False)

Find a single endpoint service

Parameters:
  • name_or_id – The name or ID of a service.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.

Returns:

One Service or None

delete_service(service, ignore_missing=True)

Delete a endpoint service

Parameters:
  • service – The service can be either the ID or a Service instance.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the service does not exist. When set to True, no exception will be set when attempting to delete a nonexistent service.

Returns:

None

Service Connection Operations

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

Return a generator of service connections

Parameters:
  • service – The service can be either the ID or a Service instance.

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

Returns:

A generator of connection objects.

Return type:

Connection

manage_service_connections(service, action, endpoints=[])

Manage endpoint service connections

Parameters:
  • service – The service can be either the ID or a Service instance.

  • action – action can be accept or reject.

  • endpoints – List of VPC Endpoints Id.

Returns:

A generator of connection objects.

Return type:

Connection

Service WhiteList Operations

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

Return a generator of service whitelist

Parameters:
  • service – The service can be either the ID or a Service instance.

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

Returns:

A generator of whitelist objects.

Return type:

Whitelist

manage_service_whitelist(service, action, domains=[])

Manage endpoint service whitelist

Parameters:
  • service – The service can be either the ID or a Service instance.

  • action – action can be add or remove.

  • domains – List of domains Ids to be added to whitelist.

Returns:

A generator of whitelist objects.

Return type:

Whitelist

Quota Operations

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

Return a generator of vpcep quota

Parameters:

type – Specify the resource type. Value of type can be: endpoint or endpoint_service

Returns:

A generator of quota objects.

Return type:

Quota