Private NAT API

The Private NAT high-level interface

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

Private NAT Gateway Operations

class otcextensions.sdk.natv3.v3._proxy.Proxy
private_nat_gateways(**query)

Return a generator of private NAT gateways.

Parameters:

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

Returns:

A generator of private NAT gateway objects.

get_private_nat_gateway(gateway)

Get a single Private Nat gateway

Parameters:

gateway – The value can be the ID of a NAT Gatway

Returns:

One PrivateNatGateway

Raises:

ResourceNotFound when no resource can be found.

private_dnat_rules(**query)

Query DNAT rules of a private NAT gateway.

This API is used to query DNAT rules.

Parameters:

query (kwargs) – Optional query parameters to filter the results. Supported parameters include: limit, marker, page_reverse, id, project_id, enterprise_project_id, description, gateway_id, transit_ip_id, external_ip_address, network_interface_id, type, private_ip_address, protocol, internal_service_port, transit_service_port, created_at, updated_at

Returns:

A generator of Dnat

create_private_dnat_rule(**attrs)

Create a private DNAT rule from attributes.

Parameters:

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

Returns:

The result of private DNAT rule creation.

Return type:

PrivateDnat

update_private_dnat_rule(dnat_rule, **attrs)

Update a private DNAT rule.

Parameters:
  • dnat_rule – The value can be either the ID of a private DNAT rule or a PrivateDnat instance.

  • attrs (dict) – The attributes to update on the DNAT rule.

Returns:

The updated private DNAT rule.

Return type:

PrivateDnat

delete_private_dnat_rule(dnat_rule, ignore_missing=True)

Delete a private DNAT rule.

Parameters:
  • dnat_rule – The value can be the ID of a private DNAT rule or a PrivateDnat instance.

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

Returns:

None

private_snat_rules(**query)

Query SNAT rules of a private NAT gateway.

This API is used to query SNAT rules.

Parameters:

query (kwargs) – Optional query parameters to filter the results. Supported parameters include: limit, marker, page_reverse, id, project_id, description, gateway_id, cidr, virsubnet_id, transit_ip_id, transit_ip_address, enterprise_project_id

Returns:

A generator of PrivateSnat

create_private_snat_rule(**attrs)

Create a private SNAT rule from attributes.

Parameters:

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

Returns:

The result of private SNAT rule creation.

Return type:

PrivateSnat

update_private_snat_rule(snat_rule, **attrs)

Update a private SNAT rule.

Parameters:
  • snat_rule – The value can be either the ID of a private SNAT rule or a PrivateSnat instance.

  • attrs (dict) – The attributes to update on the SNAT rule.

Returns:

The updated private SNAT rule.

Return type:

PrivateSnat

delete_private_snat_rule(snat_rule, ignore_missing=True)

Delete a private SNAT rule.

Parameters:
  • snat_rule – The value can be the ID of a private SNAT rule or a PrivateSnat instance.

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

Returns:

None

private_transit_ips(**query)

Query private NAT transit IP addresses.

Parameters:

query (kwargs) – Optional query parameters to filter the results. Supported parameters include: limit, marker, page_reverse, id, project_id, network_interface_id, ip_address, gateway_id, enterprise_project_id, virsubnet_id, transit_subnet_id, description

Returns:

A generator of PrivateTransitIp

get_private_transit_ip(transit_ip)

Get a single private NAT transit IP address.

Parameters:

transit_ip – The value can be the ID of a transit IP address.

Returns:

One PrivateTransitIp

Raises:

ResourceNotFound when no resource can be found.

create_private_transit_ip(**attrs)

Assign a private NAT transit IP address.

Parameters:

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

Returns:

The assigned private transit IP address.

Return type:

PrivateTransitIp

delete_private_transit_ip(transit_ip, ignore_missing=True)

Delete a private NAT transit IP address.

Parameters:
  • transit_ip – The value can be the ID of a transit IP address or a PrivateTransitIp instance.

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

Returns:

None

__init__(session: session.Session, *, service_type: str | None = None, service_name: str | None = None, interface: str | None = None, region_name: str | None = None, endpoint_override: str | None = None, version: str | None = None, auth: plugin.BaseAuthPlugin | None = None, user_agent: str | None = None, connect_retries: int | None = None, logger: logging.Logger | None = None, allow: dict[str, Any] | None = None, additional_headers: MutableMapping[str, str] | None = None, client_name: str | None = None, client_version: str | None = None, allow_version_hack: bool | None = None, global_request_id: str | None = None, min_version: str | None = None, max_version: str | None = None, default_microversion: str | None = None, status_code_retries: int | None = None, retriable_status_codes: list[int] | None = None, raise_exc: bool | None = None, rate_limit: float | None = None, concurrency: int | None = None, connect_retry_delay: float | None = None, status_code_retry_delay: float | None = None, statsd_client: statsd_client.StatsClient | None = None, statsd_prefix: str | None = None, prometheus_counter: prometheus_client.Counter | None = None, prometheus_histogram: prometheus_client.Histogram | None = None, influxdb_config: dict[str, Any] | None = None, influxdb_client: influxdb_client.InfluxDBClient | None = None)
classmethod __new__(*args, **kwargs)