Class NetworkServicesClient (0.5.16)

NetworkServicesClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.network_services_v1.services.network_services.transports.base.NetworkServicesTransport, typing.Callable[[...], google.cloud.network_services_v1.services.network_services.transports.base.NetworkServicesTransport]]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Service describing handlers for resources.

Properties

api_endpoint

Return the API endpoint used by the client instance.

Returns
Type Description
str The API endpoint used by the client instance.

transport

Returns the transport used by the client instance.

Returns
Type Description
NetworkServicesTransport The transport used by the client instance.

universe_domain

Return the universe domain used by the client instance.

Returns
Type Description
str The universe domain used by the client instance.

Methods

NetworkServicesClient

NetworkServicesClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.network_services_v1.services.network_services.transports.base.NetworkServicesTransport, typing.Callable[[...], google.cloud.network_services_v1.services.network_services.transports.base.NetworkServicesTransport]]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Instantiates the network services client.

Parameters
Name Description
credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

transport Optional[Union[str,NetworkServicesTransport,Callable[..., NetworkServicesTransport]]]

The transport to use, or a Callable that constructs and returns a new transport. If a Callable is given, it will be called with the same set of initialization arguments as used in the NetworkServicesTransport constructor. If set to None, a transport is chosen automatically.

client_options Optional[Union[google.api_core.client_options.ClientOptions, dict]]

Custom options for the client. 1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The universe_domain property can be used to override the default "googleapis.com" universe. Note that the api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

client_info google.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

Exceptions
Type Description
google.auth.exceptions.MutualTLSChannelError If mutual TLS transport creation failed for any reason.

__exit__

__exit__(type, value, traceback)

Releases underlying transport's resources.

authorization_policy_path

authorization_policy_path(
    project: str, location: str, authorization_policy: str
) -> str

Returns a fully-qualified authorization_policy string.

backend_service_path

backend_service_path(project: str, location: str, backend_service: str) -> str

Returns a fully-qualified backend_service string.

cancel_operation

cancel_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.CancelOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Starts asynchronous cancellation on a long-running operation.

The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request .operations_pb2.CancelOperationRequest

The request object. Request message for CancelOperation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

client_tls_policy_path

client_tls_policy_path(project: str, location: str, client_tls_policy: str) -> str

Returns a fully-qualified client_tls_policy string.

common_billing_account_path

common_billing_account_path(billing_account: str) -> str

Returns a fully-qualified billing_account string.

common_folder_path

common_folder_path(folder: str) -> str

Returns a fully-qualified folder string.

common_location_path

common_location_path(project: str, location: str) -> str

Returns a fully-qualified location string.

common_organization_path

common_organization_path(organization: str) -> str

Returns a fully-qualified organization string.

common_project_path

common_project_path(project: str) -> str

Returns a fully-qualified project string.

create_endpoint_policy

create_endpoint_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.endpoint_policy.CreateEndpointPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    endpoint_policy: typing.Optional[
        google.cloud.network_services_v1.types.endpoint_policy.EndpointPolicy
    ] = None,
    endpoint_policy_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new EndpointPolicy in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_endpoint_policy():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    endpoint_policy = network_services_v1.EndpointPolicy()
    endpoint_policy.name = "name_value"
    endpoint_policy.type_ = "GRPC_SERVER"

    request = network_services_v1.CreateEndpointPolicyRequest(
        parent="parent_value",
        endpoint_policy_id="endpoint_policy_id_value",
        endpoint_policy=endpoint_policy,
    )

    # Make the request
    operation = client.create_endpoint_policy(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateEndpointPolicyRequest, dict]

The request object. Request used with the CreateEndpointPolicy method.

parent str

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

endpoint_policy google.cloud.network_services_v1.types.EndpointPolicy

Required. EndpointPolicy resource to be created. This corresponds to the endpoint_policy field on the request instance; if request is provided, this should not be set.

endpoint_policy_id str

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS". This corresponds to the endpoint_policy_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be EndpointPolicy EndpointPolicy is a resource that helps apply desired configuration on the endpoints that match specific criteria. For example, this resource can be used to apply "authentication config" an all endpoints that serve on port 8080.

create_gateway

create_gateway(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.gateway.CreateGatewayRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    gateway: typing.Optional[
        google.cloud.network_services_v1.types.gateway.Gateway
    ] = None,
    gateway_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new Gateway in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_gateway():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    gateway = network_services_v1.Gateway()
    gateway.name = "name_value"
    gateway.ports = [569, 570]
    gateway.scope = "scope_value"

    request = network_services_v1.CreateGatewayRequest(
        parent="parent_value",
        gateway_id="gateway_id_value",
        gateway=gateway,
    )

    # Make the request
    operation = client.create_gateway(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateGatewayRequest, dict]

The request object. Request used by the CreateGateway method.

parent str

Required. The parent resource of the Gateway. Must be in the format projects//locations/. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

gateway google.cloud.network_services_v1.types.Gateway

Required. Gateway resource to be created. This corresponds to the gateway field on the request instance; if request is provided, this should not be set.

gateway_id str

Required. Short name of the Gateway resource to be created. This corresponds to the gateway_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be Gateway Gateway represents the configuration for a proxy, typically a load balancer. It captures the ip:port over which the services are exposed by the proxy, along with any policy configurations. Routes have reference to to Gateways to dictate how requests should be routed by this Gateway.

create_grpc_route

create_grpc_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.grpc_route.CreateGrpcRouteRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    grpc_route: typing.Optional[
        google.cloud.network_services_v1.types.grpc_route.GrpcRoute
    ] = None,
    grpc_route_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new GrpcRoute in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_grpc_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    grpc_route = network_services_v1.GrpcRoute()
    grpc_route.name = "name_value"
    grpc_route.hostnames = ['hostnames_value1', 'hostnames_value2']

    request = network_services_v1.CreateGrpcRouteRequest(
        parent="parent_value",
        grpc_route_id="grpc_route_id_value",
        grpc_route=grpc_route,
    )

    # Make the request
    operation = client.create_grpc_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateGrpcRouteRequest, dict]

The request object. Request used by the CreateGrpcRoute method.

parent str

Required. The parent resource of the GrpcRoute. Must be in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

grpc_route google.cloud.network_services_v1.types.GrpcRoute

Required. GrpcRoute resource to be created. This corresponds to the grpc_route field on the request instance; if request is provided, this should not be set.

grpc_route_id str

Required. Short name of the GrpcRoute resource to be created. This corresponds to the grpc_route_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be GrpcRoute GrpcRoute is the resource defining how gRPC traffic routed by a Mesh or Gateway resource is routed.

create_http_route

create_http_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.http_route.CreateHttpRouteRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    http_route: typing.Optional[
        google.cloud.network_services_v1.types.http_route.HttpRoute
    ] = None,
    http_route_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new HttpRoute in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_http_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    http_route = network_services_v1.HttpRoute()
    http_route.name = "name_value"
    http_route.hostnames = ['hostnames_value1', 'hostnames_value2']

    request = network_services_v1.CreateHttpRouteRequest(
        parent="parent_value",
        http_route_id="http_route_id_value",
        http_route=http_route,
    )

    # Make the request
    operation = client.create_http_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateHttpRouteRequest, dict]

The request object. Request used by the HttpRoute method.

parent str

Required. The parent resource of the HttpRoute. Must be in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

http_route google.cloud.network_services_v1.types.HttpRoute

Required. HttpRoute resource to be created. This corresponds to the http_route field on the request instance; if request is provided, this should not be set.

http_route_id str

Required. Short name of the HttpRoute resource to be created. This corresponds to the http_route_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be HttpRoute HttpRoute is the resource defining how HTTP traffic should be routed by a Mesh or Gateway resource.

create_mesh

create_mesh(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.mesh.CreateMeshRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    mesh: typing.Optional[google.cloud.network_services_v1.types.mesh.Mesh] = None,
    mesh_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new Mesh in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_mesh():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    mesh = network_services_v1.Mesh()
    mesh.name = "name_value"

    request = network_services_v1.CreateMeshRequest(
        parent="parent_value",
        mesh_id="mesh_id_value",
        mesh=mesh,
    )

    # Make the request
    operation = client.create_mesh(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateMeshRequest, dict]

The request object. Request used by the CreateMesh method.

parent str

Required. The parent resource of the Mesh. Must be in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

mesh google.cloud.network_services_v1.types.Mesh

Required. Mesh resource to be created. This corresponds to the mesh field on the request instance; if request is provided, this should not be set.

mesh_id str

Required. Short name of the Mesh resource to be created. This corresponds to the mesh_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be Mesh Mesh represents a logical configuration grouping for workload to workload communication within a service mesh. Routes that point to mesh dictate how requests are routed within this logical mesh boundary.

create_service_binding

create_service_binding(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.service_binding.CreateServiceBindingRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    service_binding: typing.Optional[
        google.cloud.network_services_v1.types.service_binding.ServiceBinding
    ] = None,
    service_binding_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new ServiceBinding in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_service_binding():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    service_binding = network_services_v1.ServiceBinding()
    service_binding.name = "name_value"
    service_binding.service = "service_value"

    request = network_services_v1.CreateServiceBindingRequest(
        parent="parent_value",
        service_binding_id="service_binding_id_value",
        service_binding=service_binding,
    )

    # Make the request
    operation = client.create_service_binding(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateServiceBindingRequest, dict]

The request object. Request used by the ServiceBinding method.

parent str

Required. The parent resource of the ServiceBinding. Must be in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

service_binding google.cloud.network_services_v1.types.ServiceBinding

Required. ServiceBinding resource to be created. This corresponds to the service_binding field on the request instance; if request is provided, this should not be set.

service_binding_id str

Required. Short name of the ServiceBinding resource to be created. This corresponds to the service_binding_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be ServiceBinding ServiceBinding is the resource that defines a Service Directory Service to be used in a BackendService resource.

create_tcp_route

create_tcp_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tcp_route.CreateTcpRouteRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    tcp_route: typing.Optional[
        google.cloud.network_services_v1.types.tcp_route.TcpRoute
    ] = None,
    tcp_route_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new TcpRoute in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_tcp_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    tcp_route = network_services_v1.TcpRoute()
    tcp_route.name = "name_value"

    request = network_services_v1.CreateTcpRouteRequest(
        parent="parent_value",
        tcp_route_id="tcp_route_id_value",
        tcp_route=tcp_route,
    )

    # Make the request
    operation = client.create_tcp_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateTcpRouteRequest, dict]

The request object. Request used by the TcpRoute method.

parent str

Required. The parent resource of the TcpRoute. Must be in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

tcp_route google.cloud.network_services_v1.types.TcpRoute

Required. TcpRoute resource to be created. This corresponds to the tcp_route field on the request instance; if request is provided, this should not be set.

tcp_route_id str

Required. Short name of the TcpRoute resource to be created. This corresponds to the tcp_route_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be TcpRoute TcpRoute is the resource defining how TCP traffic should be routed by a Mesh/Gateway resource.

create_tls_route

create_tls_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tls_route.CreateTlsRouteRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    tls_route: typing.Optional[
        google.cloud.network_services_v1.types.tls_route.TlsRoute
    ] = None,
    tls_route_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new TlsRoute in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_create_tls_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    tls_route = network_services_v1.TlsRoute()
    tls_route.name = "name_value"
    tls_route.rules.action.destinations.service_name = "service_name_value"

    request = network_services_v1.CreateTlsRouteRequest(
        parent="parent_value",
        tls_route_id="tls_route_id_value",
        tls_route=tls_route,
    )

    # Make the request
    operation = client.create_tls_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.CreateTlsRouteRequest, dict]

The request object. Request used by the TlsRoute method.

parent str

Required. The parent resource of the TlsRoute. Must be in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

tls_route google.cloud.network_services_v1.types.TlsRoute

Required. TlsRoute resource to be created. This corresponds to the tls_route field on the request instance; if request is provided, this should not be set.

tls_route_id str

Required. Short name of the TlsRoute resource to be created. This corresponds to the tls_route_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be TlsRoute TlsRoute defines how traffic should be routed based on SNI and other matching L3 attributes.

delete_endpoint_policy

delete_endpoint_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.endpoint_policy.DeleteEndpointPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single EndpointPolicy.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_endpoint_policy():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteEndpointPolicyRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_endpoint_policy(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteEndpointPolicyRequest, dict]

The request object. Request used with the DeleteEndpointPolicy method.

name str

Required. A name of the EndpointPolicy to delete. Must be in the format projects//locations/global/endpointPolicies/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_gateway

delete_gateway(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.gateway.DeleteGatewayRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single Gateway.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_gateway():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteGatewayRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_gateway(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteGatewayRequest, dict]

The request object. Request used by the DeleteGateway method.

name str

Required. A name of the Gateway to delete. Must be in the format projects//locations//gateways/*. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_grpc_route

delete_grpc_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.grpc_route.DeleteGrpcRouteRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single GrpcRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_grpc_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteGrpcRouteRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_grpc_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteGrpcRouteRequest, dict]

The request object. Request used by the DeleteGrpcRoute method.

name str

Required. A name of the GrpcRoute to delete. Must be in the format projects//locations/global/grpcRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_http_route

delete_http_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.http_route.DeleteHttpRouteRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single HttpRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_http_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteHttpRouteRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_http_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteHttpRouteRequest, dict]

The request object. Request used by the DeleteHttpRoute method.

name str

Required. A name of the HttpRoute to delete. Must be in the format projects//locations/global/httpRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_mesh

delete_mesh(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.mesh.DeleteMeshRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single Mesh.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_mesh():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteMeshRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_mesh(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteMeshRequest, dict]

The request object. Request used by the DeleteMesh method.

name str

Required. A name of the Mesh to delete. Must be in the format projects//locations/global/meshes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_operation

delete_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.DeleteOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a long-running operation.

This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request .operations_pb2.DeleteOperationRequest

The request object. Request message for DeleteOperation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

delete_service_binding

delete_service_binding(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.service_binding.DeleteServiceBindingRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single ServiceBinding.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_service_binding():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteServiceBindingRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_service_binding(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteServiceBindingRequest, dict]

The request object. Request used by the DeleteServiceBinding method.

name str

Required. A name of the ServiceBinding to delete. Must be in the format projects//locations/global/serviceBindings/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_tcp_route

delete_tcp_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tcp_route.DeleteTcpRouteRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single TcpRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_tcp_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteTcpRouteRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_tcp_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteTcpRouteRequest, dict]

The request object. Request used by the DeleteTcpRoute method.

name str

Required. A name of the TcpRoute to delete. Must be in the format projects//locations/global/tcpRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_tls_route

delete_tls_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tls_route.DeleteTlsRouteRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single TlsRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_delete_tls_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.DeleteTlsRouteRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_tls_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.DeleteTlsRouteRequest, dict]

The request object. Request used by the DeleteTlsRoute method.

name str

Required. A name of the TlsRoute to delete. Must be in the format projects//locations/global/tlsRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

endpoint_policy_path

endpoint_policy_path(project: str, location: str, endpoint_policy: str) -> str

Returns a fully-qualified endpoint_policy string.

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
NetworkServicesClient The constructed client.

from_service_account_info

from_service_account_info(info: dict, *args, **kwargs)

Creates an instance of this client using the provided credentials info.

Parameter
Name Description
info dict

The service account private key info.

Returns
Type Description
NetworkServicesClient The constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
NetworkServicesClient The constructed client.

gateway_path

gateway_path(project: str, location: str, gateway: str) -> str

Returns a fully-qualified gateway string.

get_endpoint_policy

get_endpoint_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.endpoint_policy.GetEndpointPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.endpoint_policy.EndpointPolicy

Gets details of a single EndpointPolicy.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_endpoint_policy():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetEndpointPolicyRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_endpoint_policy(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetEndpointPolicyRequest, dict]

The request object. Request used with the GetEndpointPolicy method.

name str

Required. A name of the EndpointPolicy to get. Must be in the format projects//locations/global/endpointPolicies/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.EndpointPolicy EndpointPolicy is a resource that helps apply desired configuration on the endpoints that match specific criteria. For example, this resource can be used to apply "authentication config" an all endpoints that serve on port 8080.

get_gateway

get_gateway(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.gateway.GetGatewayRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.gateway.Gateway

Gets details of a single Gateway.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_gateway():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetGatewayRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_gateway(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetGatewayRequest, dict]

The request object. Request used by the GetGateway method.

name str

Required. A name of the Gateway to get. Must be in the format projects//locations//gateways/*. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.Gateway Gateway represents the configuration for a proxy, typically a load balancer. It captures the ip:port over which the services are exposed by the proxy, along with any policy configurations. Routes have reference to to Gateways to dictate how requests should be routed by this Gateway.

get_grpc_route

get_grpc_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.grpc_route.GetGrpcRouteRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.grpc_route.GrpcRoute

Gets details of a single GrpcRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_grpc_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetGrpcRouteRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_grpc_route(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetGrpcRouteRequest, dict]

The request object. Request used by the GetGrpcRoute method.

name str

Required. A name of the GrpcRoute to get. Must be in the format projects//locations/global/grpcRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.GrpcRoute GrpcRoute is the resource defining how gRPC traffic routed by a Mesh or Gateway resource is routed.

get_http_route

get_http_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.http_route.GetHttpRouteRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.http_route.HttpRoute

Gets details of a single HttpRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_http_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetHttpRouteRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_http_route(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetHttpRouteRequest, dict]

The request object. Request used by the GetHttpRoute method.

name str

Required. A name of the HttpRoute to get. Must be in the format projects//locations/global/httpRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.HttpRoute HttpRoute is the resource defining how HTTP traffic should be routed by a Mesh or Gateway resource.

get_iam_policy

get_iam_policy(
    request: typing.Optional[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.iam.v1.policy_pb2.Policy

Gets the IAM access control policy for a function.

Returns an empty policy if the function exists and does not have a policy set.

Parameters
Name Description
request .iam_policy_pb2.GetIamPolicyRequest

The request object. Request message for GetIamPolicy method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.policy_pb2.Policy Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A Policy is a collection of bindings. A binding binds one or more members to a single role. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions (defined by IAM or configured by users). A binding can optionally specify a condition, which is a logic expression that further constrains the role binding based on attributes about the request and/or target resource. **JSON Example** :: { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01t00:00:00.000z')",="" }="" }="" ]="" }="" **yaml="" example**="" ::="" bindings:="" -="" members:="" -="" user:mike@example.com="" -="" group:admins@example.com="" -="" domain:google.com="" -="" serviceaccount:my-project-id@appspot.gserviceaccount.com="" role:="" roles/resourcemanager.organizationadmin="" -="" members:="" -="" user:eve@example.com="" role:="" roles/resourcemanager.organizationviewer="" condition:="" title:="" expirable="" access="" description:="" does="" not="" grant="" access="" after="" sep="" 2020="" expression:="" request.time="">< timestamp('2020-10-01t00:00:00.000z')="" for="" a="" description="" of="" iam="" and="" its="" features,="" see="" the="">IAM developer's guide __.

get_location

get_location(
    request: typing.Optional[
        google.cloud.location.locations_pb2.GetLocationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.location.locations_pb2.Location

Gets information about a location.

Parameters
Name Description
request .location_pb2.GetLocationRequest

The request object. Request message for GetLocation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.location_pb2.Location Location object.

get_mesh

get_mesh(
    request: typing.Optional[
        typing.Union[google.cloud.network_services_v1.types.mesh.GetMeshRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.mesh.Mesh

Gets details of a single Mesh.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_mesh():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetMeshRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_mesh(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetMeshRequest, dict]

The request object. Request used by the GetMesh method.

name str

Required. A name of the Mesh to get. Must be in the format projects//locations/global/meshes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.Mesh Mesh represents a logical configuration grouping for workload to workload communication within a service mesh. Routes that point to mesh dictate how requests are routed within this logical mesh boundary.

get_mtls_endpoint_and_cert_source

get_mtls_endpoint_and_cert_source(
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
)

Deprecated. Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameter
Name Description
client_options google.api_core.client_options.ClientOptions

Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Exceptions
Type Description
google.auth.exceptions.MutualTLSChannelError If any errors happen.
Returns
Type Description
Tuple[str, Callable[[], Tuple[bytes, bytes]]] returns the API endpoint and the client cert source to use.

get_operation

get_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.GetOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.longrunning.operations_pb2.Operation

Gets the latest state of a long-running operation.

Parameters
Name Description
request .operations_pb2.GetOperationRequest

The request object. Request message for GetOperation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.operations_pb2.Operation An Operation object.

get_service_binding

get_service_binding(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.service_binding.GetServiceBindingRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.service_binding.ServiceBinding

Gets details of a single ServiceBinding.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_service_binding():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetServiceBindingRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_service_binding(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetServiceBindingRequest, dict]

The request object. Request used by the GetServiceBinding method.

name str

Required. A name of the ServiceBinding to get. Must be in the format projects//locations/global/serviceBindings/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.ServiceBinding ServiceBinding is the resource that defines a Service Directory Service to be used in a BackendService resource.

get_tcp_route

get_tcp_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tcp_route.GetTcpRouteRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.tcp_route.TcpRoute

Gets details of a single TcpRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_tcp_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetTcpRouteRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_tcp_route(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetTcpRouteRequest, dict]

The request object. Request used by the GetTcpRoute method.

name str

Required. A name of the TcpRoute to get. Must be in the format projects//locations/global/tcpRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.TcpRoute TcpRoute is the resource defining how TCP traffic should be routed by a Mesh/Gateway resource.

get_tls_route

get_tls_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tls_route.GetTlsRouteRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.types.tls_route.TlsRoute

Gets details of a single TlsRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_get_tls_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.GetTlsRouteRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_tls_route(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.GetTlsRouteRequest, dict]

The request object. Request used by the GetTlsRoute method.

name str

Required. A name of the TlsRoute to get. Must be in the format projects//locations/global/tlsRoutes/. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.types.TlsRoute TlsRoute defines how traffic should be routed based on SNI and other matching L3 attributes.

grpc_route_path

grpc_route_path(project: str, location: str, grpc_route: str) -> str

Returns a fully-qualified grpc_route string.

http_route_path

http_route_path(project: str, location: str, http_route: str) -> str

Returns a fully-qualified http_route string.

list_endpoint_policies

list_endpoint_policies(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.endpoint_policy.ListEndpointPoliciesRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.network_services_v1.services.network_services.pagers.ListEndpointPoliciesPager
)

Lists EndpointPolicies in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_endpoint_policies():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListEndpointPoliciesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_endpoint_policies(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListEndpointPoliciesRequest, dict]

The request object. Request used with the ListEndpointPolicies method.

parent str

Required. The project and location from which the EndpointPolicies should be listed, specified in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListEndpointPoliciesPager Response returned by the ListEndpointPolicies method. Iterating over this object will yield results and resolve additional pages automatically.

list_gateways

list_gateways(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.gateway.ListGatewaysRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.network_services_v1.services.network_services.pagers.ListGatewaysPager
)

Lists Gateways in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_gateways():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListGatewaysRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_gateways(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListGatewaysRequest, dict]

The request object. Request used with the ListGateways method.

parent str

Required. The project and location from which the Gateways should be listed, specified in the format projects//locations/. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListGatewaysPager Response returned by the ListGateways method. Iterating over this object will yield results and resolve additional pages automatically.

list_grpc_routes

list_grpc_routes(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.grpc_route.ListGrpcRoutesRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.network_services_v1.services.network_services.pagers.ListGrpcRoutesPager
)

Lists GrpcRoutes in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_grpc_routes():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListGrpcRoutesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_grpc_routes(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListGrpcRoutesRequest, dict]

The request object. Request used with the ListGrpcRoutes method.

parent str

Required. The project and location from which the GrpcRoutes should be listed, specified in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListGrpcRoutesPager Response returned by the ListGrpcRoutes method. Iterating over this object will yield results and resolve additional pages automatically.

list_http_routes

list_http_routes(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.http_route.ListHttpRoutesRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.network_services_v1.services.network_services.pagers.ListHttpRoutesPager
)

Lists HttpRoute in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_http_routes():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListHttpRoutesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_http_routes(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListHttpRoutesRequest, dict]

The request object. Request used with the ListHttpRoutes method.

parent str

Required. The project and location from which the HttpRoutes should be listed, specified in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListHttpRoutesPager Response returned by the ListHttpRoutes method. Iterating over this object will yield results and resolve additional pages automatically.

list_locations

list_locations(
    request: typing.Optional[
        google.cloud.location.locations_pb2.ListLocationsRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.location.locations_pb2.ListLocationsResponse

Lists information about the supported locations for this service.

Parameters
Name Description
request .location_pb2.ListLocationsRequest

The request object. Request message for ListLocations method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.location_pb2.ListLocationsResponse Response message for ListLocations method.

list_meshes

list_meshes(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.mesh.ListMeshesRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.network_services_v1.services.network_services.pagers.ListMeshesPager

Lists Meshes in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_meshes():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListMeshesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_meshes(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListMeshesRequest, dict]

The request object. Request used with the ListMeshes method.

parent str

Required. The project and location from which the Meshes should be listed, specified in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListMeshesPager Response returned by the ListMeshes method. Iterating over this object will yield results and resolve additional pages automatically.

list_operations

list_operations(
    request: typing.Optional[
        google.longrunning.operations_pb2.ListOperationsRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.longrunning.operations_pb2.ListOperationsResponse

Lists operations that match the specified filter in the request.

Parameters
Name Description
request .operations_pb2.ListOperationsRequest

The request object. Request message for ListOperations method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.operations_pb2.ListOperationsResponse Response message for ListOperations method.

list_service_bindings

list_service_bindings(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.service_binding.ListServiceBindingsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.network_services_v1.services.network_services.pagers.ListServiceBindingsPager
)

Lists ServiceBinding in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_service_bindings():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListServiceBindingsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_service_bindings(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListServiceBindingsRequest, dict]

The request object. Request used with the ListServiceBindings method.

parent str

Required. The project and location from which the ServiceBindings should be listed, specified in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListServiceBindingsPager Response returned by the ListServiceBindings method. Iterating over this object will yield results and resolve additional pages automatically.

list_tcp_routes

list_tcp_routes(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tcp_route.ListTcpRoutesRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.network_services_v1.services.network_services.pagers.ListTcpRoutesPager
)

Lists TcpRoute in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_tcp_routes():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListTcpRoutesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_tcp_routes(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListTcpRoutesRequest, dict]

The request object. Request used with the ListTcpRoutes method.

parent str

Required. The project and location from which the TcpRoutes should be listed, specified in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListTcpRoutesPager Response returned by the ListTcpRoutes method. Iterating over this object will yield results and resolve additional pages automatically.

list_tls_routes

list_tls_routes(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tls_route.ListTlsRoutesRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.network_services_v1.services.network_services.pagers.ListTlsRoutesPager
)

Lists TlsRoute in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_list_tls_routes():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    request = network_services_v1.ListTlsRoutesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_tls_routes(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.ListTlsRoutesRequest, dict]

The request object. Request used with the ListTlsRoutes method.

parent str

Required. The project and location from which the TlsRoutes should be listed, specified in the format projects/*/locations/global. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.network_services_v1.services.network_services.pagers.ListTlsRoutesPager Response returned by the ListTlsRoutes method. Iterating over this object will yield results and resolve additional pages automatically.

mesh_path

mesh_path(project: str, location: str, mesh: str) -> str

Returns a fully-qualified mesh string.

parse_authorization_policy_path

parse_authorization_policy_path(path: str) -> typing.Dict[str, str]

Parses a authorization_policy path into its component segments.

parse_backend_service_path

parse_backend_service_path(path: str) -> typing.Dict[str, str]

Parses a backend_service path into its component segments.

parse_client_tls_policy_path

parse_client_tls_policy_path(path: str) -> typing.Dict[str, str]

Parses a client_tls_policy path into its component segments.

parse_common_billing_account_path

parse_common_billing_account_path(path: str) -> typing.Dict[str, str]

Parse a billing_account path into its component segments.

parse_common_folder_path

parse_common_folder_path(path: str) -> typing.Dict[str, str]

Parse a folder path into its component segments.

parse_common_location_path

parse_common_location_path(path: str) -> typing.Dict[str, str]

Parse a location path into its component segments.

parse_common_organization_path

parse_common_organization_path(path: str) -> typing.Dict[str, str]

Parse a organization path into its component segments.

parse_common_project_path

parse_common_project_path(path: str) -> typing.Dict[str, str]

Parse a project path into its component segments.

parse_endpoint_policy_path

parse_endpoint_policy_path(path: str) -> typing.Dict[str, str]

Parses a endpoint_policy path into its component segments.

parse_gateway_path

parse_gateway_path(path: str) -> typing.Dict[str, str]

Parses a gateway path into its component segments.

parse_grpc_route_path

parse_grpc_route_path(path: str) -> typing.Dict[str, str]

Parses a grpc_route path into its component segments.

parse_http_route_path

parse_http_route_path(path: str) -> typing.Dict[str, str]

Parses a http_route path into its component segments.

parse_mesh_path

parse_mesh_path(path: str) -> typing.Dict[str, str]

Parses a mesh path into its component segments.

parse_server_tls_policy_path

parse_server_tls_policy_path(path: str) -> typing.Dict[str, str]

Parses a server_tls_policy path into its component segments.

parse_service_binding_path

parse_service_binding_path(path: str) -> typing.Dict[str, str]

Parses a service_binding path into its component segments.

parse_tcp_route_path

parse_tcp_route_path(path: str) -> typing.Dict[str, str]

Parses a tcp_route path into its component segments.

parse_tls_route_path

parse_tls_route_path(path: str) -> typing.Dict[str, str]

Parses a tls_route path into its component segments.

server_tls_policy_path

server_tls_policy_path(project: str, location: str, server_tls_policy: str) -> str

Returns a fully-qualified server_tls_policy string.

service_binding_path

service_binding_path(project: str, location: str, service_binding: str) -> str

Returns a fully-qualified service_binding string.

set_iam_policy

set_iam_policy(
    request: typing.Optional[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.iam.v1.policy_pb2.Policy

Sets the IAM access control policy on the specified function.

Replaces any existing policy.

Parameters
Name Description
request .iam_policy_pb2.SetIamPolicyRequest

The request object. Request message for SetIamPolicy method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.policy_pb2.Policy Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A Policy is a collection of bindings. A binding binds one or more members to a single role. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions (defined by IAM or configured by users). A binding can optionally specify a condition, which is a logic expression that further constrains the role binding based on attributes about the request and/or target resource. **JSON Example** :: { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01t00:00:00.000z')",="" }="" }="" ]="" }="" **yaml="" example**="" ::="" bindings:="" -="" members:="" -="" user:mike@example.com="" -="" group:admins@example.com="" -="" domain:google.com="" -="" serviceaccount:my-project-id@appspot.gserviceaccount.com="" role:="" roles/resourcemanager.organizationadmin="" -="" members:="" -="" user:eve@example.com="" role:="" roles/resourcemanager.organizationviewer="" condition:="" title:="" expirable="" access="" description:="" does="" not="" grant="" access="" after="" sep="" 2020="" expression:="" request.time="">< timestamp('2020-10-01t00:00:00.000z')="" for="" a="" description="" of="" iam="" and="" its="" features,="" see="" the="">IAM developer's guide __.

tcp_route_path

tcp_route_path(project: str, location: str, tcp_route: str) -> str

Returns a fully-qualified tcp_route string.

test_iam_permissions

test_iam_permissions(
    request: typing.Optional[
        google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse

Tests the specified IAM permissions against the IAM access control policy for a function.

If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Parameters
Name Description
request .iam_policy_pb2.TestIamPermissionsRequest

The request object. Request message for TestIamPermissions method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.iam_policy_pb2.TestIamPermissionsResponse Response message for TestIamPermissions method.

tls_route_path

tls_route_path(project: str, location: str, tls_route: str) -> str

Returns a fully-qualified tls_route string.

update_endpoint_policy

update_endpoint_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.endpoint_policy.UpdateEndpointPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    endpoint_policy: typing.Optional[
        google.cloud.network_services_v1.types.endpoint_policy.EndpointPolicy
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single EndpointPolicy.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_update_endpoint_policy():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    endpoint_policy = network_services_v1.EndpointPolicy()
    endpoint_policy.name = "name_value"
    endpoint_policy.type_ = "GRPC_SERVER"

    request = network_services_v1.UpdateEndpointPolicyRequest(
        endpoint_policy=endpoint_policy,
    )

    # Make the request
    operation = client.update_endpoint_policy(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.UpdateEndpointPolicyRequest, dict]

The request object. Request used with the UpdateEndpointPolicy method.

endpoint_policy google.cloud.network_services_v1.types.EndpointPolicy

Required. Updated EndpointPolicy resource. This corresponds to the endpoint_policy field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the EndpointPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be EndpointPolicy EndpointPolicy is a resource that helps apply desired configuration on the endpoints that match specific criteria. For example, this resource can be used to apply "authentication config" an all endpoints that serve on port 8080.

update_gateway

update_gateway(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.gateway.UpdateGatewayRequest, dict
        ]
    ] = None,
    *,
    gateway: typing.Optional[
        google.cloud.network_services_v1.types.gateway.Gateway
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single Gateway.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_update_gateway():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    gateway = network_services_v1.Gateway()
    gateway.name = "name_value"
    gateway.ports = [569, 570]
    gateway.scope = "scope_value"

    request = network_services_v1.UpdateGatewayRequest(
        gateway=gateway,
    )

    # Make the request
    operation = client.update_gateway(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.UpdateGatewayRequest, dict]

The request object. Request used by the UpdateGateway method.

gateway google.cloud.network_services_v1.types.Gateway

Required. Updated Gateway resource. This corresponds to the gateway field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Gateway resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be Gateway Gateway represents the configuration for a proxy, typically a load balancer. It captures the ip:port over which the services are exposed by the proxy, along with any policy configurations. Routes have reference to to Gateways to dictate how requests should be routed by this Gateway.

update_grpc_route

update_grpc_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.grpc_route.UpdateGrpcRouteRequest,
            dict,
        ]
    ] = None,
    *,
    grpc_route: typing.Optional[
        google.cloud.network_services_v1.types.grpc_route.GrpcRoute
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single GrpcRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_update_grpc_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    grpc_route = network_services_v1.GrpcRoute()
    grpc_route.name = "name_value"
    grpc_route.hostnames = ['hostnames_value1', 'hostnames_value2']

    request = network_services_v1.UpdateGrpcRouteRequest(
        grpc_route=grpc_route,
    )

    # Make the request
    operation = client.update_grpc_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.UpdateGrpcRouteRequest, dict]

The request object. Request used by the UpdateGrpcRoute method.

grpc_route google.cloud.network_services_v1.types.GrpcRoute

Required. Updated GrpcRoute resource. This corresponds to the grpc_route field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the GrpcRoute resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be GrpcRoute GrpcRoute is the resource defining how gRPC traffic routed by a Mesh or Gateway resource is routed.

update_http_route

update_http_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.http_route.UpdateHttpRouteRequest,
            dict,
        ]
    ] = None,
    *,
    http_route: typing.Optional[
        google.cloud.network_services_v1.types.http_route.HttpRoute
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single HttpRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_update_http_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    http_route = network_services_v1.HttpRoute()
    http_route.name = "name_value"
    http_route.hostnames = ['hostnames_value1', 'hostnames_value2']

    request = network_services_v1.UpdateHttpRouteRequest(
        http_route=http_route,
    )

    # Make the request
    operation = client.update_http_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.UpdateHttpRouteRequest, dict]

The request object. Request used by the UpdateHttpRoute method.

http_route google.cloud.network_services_v1.types.HttpRoute

Required. Updated HttpRoute resource. This corresponds to the http_route field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the HttpRoute resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be HttpRoute HttpRoute is the resource defining how HTTP traffic should be routed by a Mesh or Gateway resource.

update_mesh

update_mesh(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.mesh.UpdateMeshRequest, dict
        ]
    ] = None,
    *,
    mesh: typing.Optional[google.cloud.network_services_v1.types.mesh.Mesh] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single Mesh.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_update_mesh():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    mesh = network_services_v1.Mesh()
    mesh.name = "name_value"

    request = network_services_v1.UpdateMeshRequest(
        mesh=mesh,
    )

    # Make the request
    operation = client.update_mesh(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.UpdateMeshRequest, dict]

The request object. Request used by the UpdateMesh method.

mesh google.cloud.network_services_v1.types.Mesh

Required. Updated Mesh resource. This corresponds to the mesh field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Mesh resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be Mesh Mesh represents a logical configuration grouping for workload to workload communication within a service mesh. Routes that point to mesh dictate how requests are routed within this logical mesh boundary.

update_tcp_route

update_tcp_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tcp_route.UpdateTcpRouteRequest, dict
        ]
    ] = None,
    *,
    tcp_route: typing.Optional[
        google.cloud.network_services_v1.types.tcp_route.TcpRoute
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single TcpRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_update_tcp_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    tcp_route = network_services_v1.TcpRoute()
    tcp_route.name = "name_value"

    request = network_services_v1.UpdateTcpRouteRequest(
        tcp_route=tcp_route,
    )

    # Make the request
    operation = client.update_tcp_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.UpdateTcpRouteRequest, dict]

The request object. Request used by the UpdateTcpRoute method.

tcp_route google.cloud.network_services_v1.types.TcpRoute

Required. Updated TcpRoute resource. This corresponds to the tcp_route field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the TcpRoute resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be TcpRoute TcpRoute is the resource defining how TCP traffic should be routed by a Mesh/Gateway resource.

update_tls_route

update_tls_route(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_services_v1.types.tls_route.UpdateTlsRouteRequest, dict
        ]
    ] = None,
    *,
    tls_route: typing.Optional[
        google.cloud.network_services_v1.types.tls_route.TlsRoute
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single TlsRoute.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import network_services_v1

def sample_update_tls_route():
    # Create a client
    client = network_services_v1.NetworkServicesClient()

    # Initialize request argument(s)
    tls_route = network_services_v1.TlsRoute()
    tls_route.name = "name_value"
    tls_route.rules.action.destinations.service_name = "service_name_value"

    request = network_services_v1.UpdateTlsRouteRequest(
        tls_route=tls_route,
    )

    # Make the request
    operation = client.update_tls_route(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.network_services_v1.types.UpdateTlsRouteRequest, dict]

The request object. Request used by the UpdateTlsRoute method.

tls_route google.cloud.network_services_v1.types.TlsRoute

Required. Updated TlsRoute resource. This corresponds to the tls_route field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the TlsRoute resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be TlsRoute TlsRoute defines how traffic should be routed based on SNI and other matching L3 attributes.