Class NetworkSecurityClient (0.10.0)

NetworkSecurityClient(
    *,
    credentials: typing.Optional[google.auth.credentials.Credentials] = None,
    transport: typing.Optional[
        typing.Union[
            str,
            google.cloud.network_security_v1alpha1.services.network_security.transports.base.NetworkSecurityTransport,
            typing.Callable[
                [...],
                google.cloud.network_security_v1alpha1.services.network_security.transports.base.NetworkSecurityTransport,
            ],
        ]
    ] = 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
)

Network Security API provides resources to configure authentication and authorization policies. Refer to per API resource documentation for more information.

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
NetworkSecurityTransport 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

NetworkSecurityClient

NetworkSecurityClient(
    *,
    credentials: typing.Optional[google.auth.credentials.Credentials] = None,
    transport: typing.Optional[
        typing.Union[
            str,
            google.cloud.network_security_v1alpha1.services.network_security.transports.base.NetworkSecurityTransport,
            typing.Callable[
                [...],
                google.cloud.network_security_v1alpha1.services.network_security.transports.base.NetworkSecurityTransport,
            ],
        ]
    ] = 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
)

Instantiates the network security 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,NetworkSecurityTransport,Callable[..., NetworkSecurityTransport]]]

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 NetworkSecurityTransport 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.

authz_policy_path

authz_policy_path(project: str, location: str, authz_policy: str) -> str

Returns a fully-qualified authz_policy string.

backend_authentication_config_path

backend_authentication_config_path(
    project: str, location: str, backend_authentication_config: str
) -> str

Returns a fully-qualified backend_authentication_config string.

ca_pool_path

ca_pool_path(project: str, location: str, ca_pool: str) -> str

Returns a fully-qualified ca_pool 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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

certificate_path

certificate_path(project: str, location: str, certificate: str) -> str

Returns a fully-qualified certificate string.

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_authorization_policy

create_authorization_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authorization_policy.CreateAuthorizationPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    authorization_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.authorization_policy.AuthorizationPolicy
    ] = None,
    authorization_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new AuthorizationPolicy 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_security_v1alpha1

def sample_create_authorization_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    authorization_policy = network_security_v1alpha1.AuthorizationPolicy()
    authorization_policy.name = "name_value"
    authorization_policy.action = "DENY"

    request = network_security_v1alpha1.CreateAuthorizationPolicyRequest(
        parent="parent_value",
        authorization_policy_id="authorization_policy_id_value",
        authorization_policy=authorization_policy,
    )

    # Make the request
    operation = client.create_authorization_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_security_v1alpha1.types.CreateAuthorizationPolicyRequest, dict]

The request object. Request used by the CreateAuthorizationPolicy method.

parent str

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

authorization_policy google.cloud.network_security_v1alpha1.types.AuthorizationPolicy

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

authorization_policy_id str

Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy". This corresponds to the authorization_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be AuthorizationPolicy AuthorizationPolicy is a resource that specifies how a server should authorize incoming connections. This resource in itself does not change the configuration unless it's attached to a target https proxy or endpoint config selector resource.

create_authz_policy

create_authz_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authz_policy.CreateAuthzPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    authz_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.authz_policy.AuthzPolicy
    ] = None,
    authz_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new AuthzPolicy 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_security_v1alpha1

def sample_create_authz_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    authz_policy = network_security_v1alpha1.AuthzPolicy()
    authz_policy.name = "name_value"
    authz_policy.target.load_balancing_scheme = "INTERNAL_SELF_MANAGED"
    authz_policy.target.resources = ['resources_value1', 'resources_value2']
    authz_policy.action = "CUSTOM"

    request = network_security_v1alpha1.CreateAuthzPolicyRequest(
        parent="parent_value",
        authz_policy_id="authz_policy_id_value",
        authz_policy=authz_policy,
    )

    # Make the request
    operation = client.create_authz_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_security_v1alpha1.types.CreateAuthzPolicyRequest, dict]

The request object. Message for creating an AuthzPolicy resource.

parent str

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

authz_policy google.cloud.network_security_v1alpha1.types.AuthzPolicy

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

authz_policy_id str

Required. User-provided ID of the AuthzPolicy resource to be created. This corresponds to the authz_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be AuthzPolicy AuthzPolicy is a resource that allows to forward traffic to a callout backend designed to scan the traffic for security purposes.

create_backend_authentication_config

create_backend_authentication_config(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.backend_authentication_config.CreateBackendAuthenticationConfigRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    backend_authentication_config: typing.Optional[
        google.cloud.network_security_v1alpha1.types.backend_authentication_config.BackendAuthenticationConfig
    ] = None,
    backend_authentication_config_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new BackendAuthenticationConfig 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_security_v1alpha1

def sample_create_backend_authentication_config():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    backend_authentication_config = network_security_v1alpha1.BackendAuthenticationConfig()
    backend_authentication_config.name = "name_value"

    request = network_security_v1alpha1.CreateBackendAuthenticationConfigRequest(
        parent="parent_value",
        backend_authentication_config_id="backend_authentication_config_id_value",
        backend_authentication_config=backend_authentication_config,
    )

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

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

    response = operation.result()

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

The request object. Request used by the CreateBackendAuthenticationConfig method.

parent str

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

backend_authentication_config google.cloud.network_security_v1alpha1.types.BackendAuthenticationConfig

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

backend_authentication_config_id str

Required. Short name of the BackendAuthenticationConfig resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "backend-auth-config". This corresponds to the backend_authentication_config_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be BackendAuthenticationConfig BackendAuthenticationConfig message groups the TrustConfig together with other settings that control how the load balancer authenticates, and expresses its identity to, the backend: - trustConfig is the attached TrustConfig. \* wellKnownRoots indicates whether the load balance should trust backend server certificates that are issued by public certificate authorities, in addition to certificates trusted by the TrustConfig. \* clientCertificate is a client certificate that the load balancer uses to express its identity to the backend, if the connection to the backend uses mTLS. You can attach the BackendAuthenticationConfig to the load balancer's BackendService directly determining how that BackendService negotiates TLS.

create_client_tls_policy

create_client_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.client_tls_policy.CreateClientTlsPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    client_tls_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.client_tls_policy.ClientTlsPolicy
    ] = None,
    client_tls_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new ClientTlsPolicy 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_security_v1alpha1

def sample_create_client_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    client_tls_policy = network_security_v1alpha1.ClientTlsPolicy()
    client_tls_policy.name = "name_value"

    request = network_security_v1alpha1.CreateClientTlsPolicyRequest(
        parent="parent_value",
        client_tls_policy_id="client_tls_policy_id_value",
        client_tls_policy=client_tls_policy,
    )

    # Make the request
    operation = client.create_client_tls_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_security_v1alpha1.types.CreateClientTlsPolicyRequest, dict]

The request object. Request used by the CreateClientTlsPolicy method.

parent str

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

client_tls_policy google.cloud.network_security_v1alpha1.types.ClientTlsPolicy

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

client_tls_policy_id str

Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy". This corresponds to the client_tls_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be ClientTlsPolicy ClientTlsPolicy is a resource that specifies how a client should authenticate connections to backends of a service. This resource itself does not affect configuration unless it is attached to a backend service resource.

create_gateway_security_policy

create_gateway_security_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy.CreateGatewaySecurityPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    gateway_security_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.gateway_security_policy.GatewaySecurityPolicy
    ] = None,
    gateway_security_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new GatewaySecurityPolicy 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_security_v1alpha1

def sample_create_gateway_security_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    gateway_security_policy = network_security_v1alpha1.GatewaySecurityPolicy()
    gateway_security_policy.name = "name_value"

    request = network_security_v1alpha1.CreateGatewaySecurityPolicyRequest(
        parent="parent_value",
        gateway_security_policy_id="gateway_security_policy_id_value",
        gateway_security_policy=gateway_security_policy,
    )

    # Make the request
    operation = client.create_gateway_security_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_security_v1alpha1.types.CreateGatewaySecurityPolicyRequest, dict]

The request object. Request used by the CreateGatewaySecurityPolicy method.

parent str

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

gateway_security_policy google.cloud.network_security_v1alpha1.types.GatewaySecurityPolicy

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

gateway_security_policy_id str

Required. Short name of the GatewaySecurityPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "gateway_security_policy1". This corresponds to the gateway_security_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be GatewaySecurityPolicy The GatewaySecurityPolicy resource contains a collection of GatewaySecurityPolicyRules and associated metadata.

create_gateway_security_policy_rule

create_gateway_security_policy_rule(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.CreateGatewaySecurityPolicyRuleRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    gateway_security_policy_rule: typing.Optional[
        google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.GatewaySecurityPolicyRule
    ] = None,
    gateway_security_policy_rule_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new GatewaySecurityPolicy 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_security_v1alpha1

def sample_create_gateway_security_policy_rule():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    gateway_security_policy_rule = network_security_v1alpha1.GatewaySecurityPolicyRule()
    gateway_security_policy_rule.basic_profile = "DENY"
    gateway_security_policy_rule.name = "name_value"
    gateway_security_policy_rule.enabled = True
    gateway_security_policy_rule.priority = 898
    gateway_security_policy_rule.session_matcher = "session_matcher_value"

    request = network_security_v1alpha1.CreateGatewaySecurityPolicyRuleRequest(
        parent="parent_value",
        gateway_security_policy_rule=gateway_security_policy_rule,
    )

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

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

    response = operation.result()

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

The request object. Methods for GatewaySecurityPolicy RULES/GatewaySecurityPolicyRules. Request used by the CreateGatewaySecurityPolicyRule method.

parent str

Required. The parent where this rule will be created. Format : projects/{project}/location/{location}/gatewaySecurityPolicies/* This corresponds to the parent field on the request instance; if request is provided, this should not be set.

gateway_security_policy_rule google.cloud.network_security_v1alpha1.types.GatewaySecurityPolicyRule

Required. The rule to be created. This corresponds to the gateway_security_policy_rule field on the request instance; if request is provided, this should not be set.

gateway_security_policy_rule_id str

The ID to use for the rule, which will become the final component of the rule's resource name. This value should be 4-63 characters, and valid characters are /a-z][0-9]-/. This corresponds to the gateway_security_policy_rule_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be GatewaySecurityPolicyRule The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents a traffic matching condition and associated action to perform.

create_server_tls_policy

create_server_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.server_tls_policy.CreateServerTlsPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    server_tls_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.server_tls_policy.ServerTlsPolicy
    ] = None,
    server_tls_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new ServerTlsPolicy 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_security_v1alpha1

def sample_create_server_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    server_tls_policy = network_security_v1alpha1.ServerTlsPolicy()
    server_tls_policy.name = "name_value"

    request = network_security_v1alpha1.CreateServerTlsPolicyRequest(
        parent="parent_value",
        server_tls_policy_id="server_tls_policy_id_value",
        server_tls_policy=server_tls_policy,
    )

    # Make the request
    operation = client.create_server_tls_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_security_v1alpha1.types.CreateServerTlsPolicyRequest, dict]

The request object. Request used by the CreateServerTlsPolicy method.

parent str

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

server_tls_policy google.cloud.network_security_v1alpha1.types.ServerTlsPolicy

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

server_tls_policy_id str

Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy". This corresponds to the server_tls_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be ServerTlsPolicy ServerTlsPolicy is a resource that specifies how a server should authenticate incoming requests. This resource itself does not affect configuration unless it is attached to a target HTTPS proxy or endpoint config selector resource. ServerTlsPolicy in the form accepted by Application Load Balancers can be attached only to TargetHttpsProxy with an EXTERNAL, EXTERNAL_MANAGED or INTERNAL_MANAGED load balancing scheme. Traffic Director compatible ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with Traffic Director INTERNAL_SELF_MANAGED load balancing scheme.

create_tls_inspection_policy

create_tls_inspection_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.tls_inspection_policy.CreateTlsInspectionPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    tls_inspection_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.tls_inspection_policy.TlsInspectionPolicy
    ] = None,
    tls_inspection_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new TlsInspectionPolicy 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_security_v1alpha1

def sample_create_tls_inspection_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    tls_inspection_policy = network_security_v1alpha1.TlsInspectionPolicy()
    tls_inspection_policy.name = "name_value"
    tls_inspection_policy.ca_pool = "ca_pool_value"

    request = network_security_v1alpha1.CreateTlsInspectionPolicyRequest(
        parent="parent_value",
        tls_inspection_policy_id="tls_inspection_policy_id_value",
        tls_inspection_policy=tls_inspection_policy,
    )

    # Make the request
    operation = client.create_tls_inspection_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_security_v1alpha1.types.CreateTlsInspectionPolicyRequest, dict]

The request object. Request used by the CreateTlsInspectionPolicy method.

parent str

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

tls_inspection_policy google.cloud.network_security_v1alpha1.types.TlsInspectionPolicy

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

tls_inspection_policy_id str

Required. Short name of the TlsInspectionPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "tls_inspection_policy1". This corresponds to the tls_inspection_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be TlsInspectionPolicy The TlsInspectionPolicy resource contains references to CA pools in Certificate Authority Service and associated metadata.

create_url_list

create_url_list(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.url_list.CreateUrlListRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    url_list: typing.Optional[
        google.cloud.network_security_v1alpha1.types.url_list.UrlList
    ] = None,
    url_list_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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Creates a new UrlList 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_security_v1alpha1

def sample_create_url_list():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    url_list = network_security_v1alpha1.UrlList()
    url_list.name = "name_value"
    url_list.values = ['values_value1', 'values_value2']

    request = network_security_v1alpha1.CreateUrlListRequest(
        parent="parent_value",
        url_list_id="url_list_id_value",
        url_list=url_list,
    )

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

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

    response = operation.result()

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

The request object. Request used by the CreateUrlList method.

parent str

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

url_list google.cloud.network_security_v1alpha1.types.UrlList

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

url_list_id str

Required. Short name of the UrlList resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "url_list". This corresponds to the url_list_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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be UrlList UrlList proto helps users to set reusable, independently manageable lists of hosts, host patterns, URLs, URL patterns.

delete_authorization_policy

delete_authorization_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authorization_policy.DeleteAuthorizationPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single AuthorizationPolicy.

# 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_security_v1alpha1

def sample_delete_authorization_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteAuthorizationPolicyRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_authorization_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_security_v1alpha1.types.DeleteAuthorizationPolicyRequest, dict]

The request object. Request used by the DeleteAuthorizationPolicy method.

name str

Required. A name of the AuthorizationPolicy to delete. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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_authz_policy

delete_authz_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authz_policy.DeleteAuthzPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single AuthzPolicy.

# 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_security_v1alpha1

def sample_delete_authz_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteAuthzPolicyRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_authz_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_security_v1alpha1.types.DeleteAuthzPolicyRequest, dict]

The request object. Message for deleting an AuthzPolicy resource.

name str

Required. The name of the AuthzPolicy resource to delete. Must be in the format projects/{project}/locations/{location}/authzPolicies/{authz_policy}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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_backend_authentication_config

delete_backend_authentication_config(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.backend_authentication_config.DeleteBackendAuthenticationConfigRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.

# 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_security_v1alpha1

def sample_delete_backend_authentication_config():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteBackendAuthenticationConfigRequest(
        name="name_value",
    )

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

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

    response = operation.result()

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

The request object. Request used by the DeleteBackendAuthenticationConfig method.

name str

Required. A name of the BackendAuthenticationConfig to delete. Must be in the format projects//locations/{location}/backendAuthenticationConfigs/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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_client_tls_policy

delete_client_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.client_tls_policy.DeleteClientTlsPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single ClientTlsPolicy.

# 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_security_v1alpha1

def sample_delete_client_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteClientTlsPolicyRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_client_tls_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_security_v1alpha1.types.DeleteClientTlsPolicyRequest, dict]

The request object. Request used by the DeleteClientTlsPolicy method.

name str

Required. A name of the ClientTlsPolicy to delete. Must be in the format projects//locations/{location}/clientTlsPolicies/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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_security_policy

delete_gateway_security_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy.DeleteGatewaySecurityPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single GatewaySecurityPolicy.

# 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_security_v1alpha1

def sample_delete_gateway_security_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteGatewaySecurityPolicyRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_gateway_security_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_security_v1alpha1.types.DeleteGatewaySecurityPolicyRequest, dict]

The request object. Request used by the DeleteGatewaySecurityPolicy method.

name str

Required. A name of the GatewaySecurityPolicy to delete. Must be in the format projects/{project}/locations/{location}/gatewaySecurityPolicies/*. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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_security_policy_rule

delete_gateway_security_policy_rule(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.DeleteGatewaySecurityPolicyRuleRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single GatewaySecurityPolicyRule.

# 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_security_v1alpha1

def sample_delete_gateway_security_policy_rule():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteGatewaySecurityPolicyRuleRequest(
        name="name_value",
    )

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

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

    response = operation.result()

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

The request object. Request used by the DeleteGatewaySecurityPolicyRule method.

name str

Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the format projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

delete_server_tls_policy

delete_server_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.server_tls_policy.DeleteServerTlsPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single ServerTlsPolicy.

# 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_security_v1alpha1

def sample_delete_server_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteServerTlsPolicyRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_server_tls_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_security_v1alpha1.types.DeleteServerTlsPolicyRequest, dict]

The request object. Request used by the DeleteServerTlsPolicy method.

name str

Required. A name of the ServerTlsPolicy to delete. Must be in the format projects//locations/{location}/serverTlsPolicies/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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_inspection_policy

delete_tls_inspection_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.tls_inspection_policy.DeleteTlsInspectionPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single TlsInspectionPolicy.

# 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_security_v1alpha1

def sample_delete_tls_inspection_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteTlsInspectionPolicyRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_tls_inspection_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_security_v1alpha1.types.DeleteTlsInspectionPolicyRequest, dict]

The request object. Request used by the DeleteTlsInspectionPolicy method.

name str

Required. A name of the TlsInspectionPolicy to delete. Must be in the format projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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_url_list

delete_url_list(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.url_list.DeleteUrlListRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Deletes a single UrlList.

# 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_security_v1alpha1

def sample_delete_url_list():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.DeleteUrlListRequest(
        name="name_value",
    )

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

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

    response = operation.result()

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

The request object. Request used by the DeleteUrlList method.

name str

Required. A name of the UrlList to delete. Must be in the format projects//locations/{location}/urlLists/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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); }

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
NetworkSecurityClient 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
NetworkSecurityClient 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
NetworkSecurityClient The constructed client.

gateway_security_policy_path

gateway_security_policy_path(
    project: str, location: str, gateway_security_policy: str
) -> str

Returns a fully-qualified gateway_security_policy string.

gateway_security_policy_rule_path

gateway_security_policy_rule_path(
    project: str, location: str, gateway_security_policy: str, rule: str
) -> str

Returns a fully-qualified gateway_security_policy_rule string.

get_authorization_policy

get_authorization_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authorization_policy.GetAuthorizationPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.types.authorization_policy.AuthorizationPolicy
)

Gets details of a single AuthorizationPolicy.

# 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_security_v1alpha1

def sample_get_authorization_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetAuthorizationPolicyRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetAuthorizationPolicy method.

name str

Required. A name of the AuthorizationPolicy to get. Must be in the format projects/{project}/locations/{location}/authorizationPolicies/*. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.AuthorizationPolicy AuthorizationPolicy is a resource that specifies how a server should authorize incoming connections. This resource in itself does not change the configuration unless it's attached to a target https proxy or endpoint config selector resource.

get_authz_policy

get_authz_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authz_policy.GetAuthzPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.cloud.network_security_v1alpha1.types.authz_policy.AuthzPolicy

Gets details of a single AuthzPolicy.

# 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_security_v1alpha1

def sample_get_authz_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetAuthzPolicyRequest(
        name="name_value",
    )

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

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

The request object. Message for getting a AuthzPolicy resource.

name str

Required. A name of the AuthzPolicy resource to get. Must be in the format projects/{project}/locations/{location}/authzPolicies/{authz_policy}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.AuthzPolicy AuthzPolicy is a resource that allows to forward traffic to a callout backend designed to scan the traffic for security purposes.

get_backend_authentication_config

get_backend_authentication_config(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.backend_authentication_config.GetBackendAuthenticationConfigRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.types.backend_authentication_config.BackendAuthenticationConfig
)

Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

# 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_security_v1alpha1

def sample_get_backend_authentication_config():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetBackendAuthenticationConfigRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetBackendAuthenticationConfig method.

name str

Required. A name of the BackendAuthenticationConfig to get. Must be in the format projects//locations/{location}/backendAuthenticationConfigs/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.BackendAuthenticationConfig BackendAuthenticationConfig message groups the TrustConfig together with other settings that control how the load balancer authenticates, and expresses its identity to, the backend: - trustConfig is the attached TrustConfig. \* wellKnownRoots indicates whether the load balance should trust backend server certificates that are issued by public certificate authorities, in addition to certificates trusted by the TrustConfig. \* clientCertificate is a client certificate that the load balancer uses to express its identity to the backend, if the connection to the backend uses mTLS. You can attach the BackendAuthenticationConfig to the load balancer's BackendService directly determining how that BackendService negotiates TLS.

get_client_tls_policy

get_client_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.client_tls_policy.GetClientTlsPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.cloud.network_security_v1alpha1.types.client_tls_policy.ClientTlsPolicy

Gets details of a single ClientTlsPolicy.

# 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_security_v1alpha1

def sample_get_client_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetClientTlsPolicyRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetClientTlsPolicy method.

name str

Required. A name of the ClientTlsPolicy to get. Must be in the format projects//locations/{location}/clientTlsPolicies/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.ClientTlsPolicy ClientTlsPolicy is a resource that specifies how a client should authenticate connections to backends of a service. This resource itself does not affect configuration unless it is attached to a backend service resource.

get_gateway_security_policy

get_gateway_security_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy.GetGatewaySecurityPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.types.gateway_security_policy.GatewaySecurityPolicy
)

Gets details of a single GatewaySecurityPolicy.

# 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_security_v1alpha1

def sample_get_gateway_security_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetGatewaySecurityPolicyRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetGatewaySecurityPolicy method.

name str

Required. A name of the GatewaySecurityPolicy to get. Must be in the format projects/{project}/locations/{location}/gatewaySecurityPolicies/*. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.GatewaySecurityPolicy The GatewaySecurityPolicy resource contains a collection of GatewaySecurityPolicyRules and associated metadata.

get_gateway_security_policy_rule

get_gateway_security_policy_rule(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.GetGatewaySecurityPolicyRuleRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.GatewaySecurityPolicyRule
)

Gets details of a single GatewaySecurityPolicyRule.

# 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_security_v1alpha1

def sample_get_gateway_security_policy_rule():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetGatewaySecurityPolicyRuleRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetGatewaySecurityPolicyRule method.

name str

Required. The name of the GatewaySecurityPolicyRule to retrieve. Format: projects/{project}/location/{location}/gatewaySecurityPolicies//rules/ 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.GatewaySecurityPolicyRule The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents a traffic matching condition and associated action to perform.

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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
.location_pb2.Location Location object.

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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
.operations_pb2.Operation An Operation object.

get_server_tls_policy

get_server_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.server_tls_policy.GetServerTlsPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.cloud.network_security_v1alpha1.types.server_tls_policy.ServerTlsPolicy

Gets details of a single ServerTlsPolicy.

# 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_security_v1alpha1

def sample_get_server_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetServerTlsPolicyRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetServerTlsPolicy method.

name str

Required. A name of the ServerTlsPolicy to get. Must be in the format projects//locations/{location}/serverTlsPolicies/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.ServerTlsPolicy ServerTlsPolicy is a resource that specifies how a server should authenticate incoming requests. This resource itself does not affect configuration unless it is attached to a target HTTPS proxy or endpoint config selector resource. ServerTlsPolicy in the form accepted by Application Load Balancers can be attached only to TargetHttpsProxy with an EXTERNAL, EXTERNAL_MANAGED or INTERNAL_MANAGED load balancing scheme. Traffic Director compatible ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with Traffic Director INTERNAL_SELF_MANAGED load balancing scheme.

get_tls_inspection_policy

get_tls_inspection_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.tls_inspection_policy.GetTlsInspectionPolicyRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.types.tls_inspection_policy.TlsInspectionPolicy
)

Gets details of a single TlsInspectionPolicy.

# 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_security_v1alpha1

def sample_get_tls_inspection_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetTlsInspectionPolicyRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetTlsInspectionPolicy method.

name str

Required. A name of the TlsInspectionPolicy to get. Must be in the format projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.TlsInspectionPolicy The TlsInspectionPolicy resource contains references to CA pools in Certificate Authority Service and associated metadata.

get_url_list

get_url_list(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.url_list.GetUrlListRequest,
            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, typing.Union[str, bytes]]] = ()
) -> google.cloud.network_security_v1alpha1.types.url_list.UrlList

Gets details of a single UrlList.

# 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_security_v1alpha1

def sample_get_url_list():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.GetUrlListRequest(
        name="name_value",
    )

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

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

The request object. Request used by the GetUrlList method.

name str

Required. A name of the UrlList to get. Must be in the format projects//locations/{location}/urlLists/. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.types.UrlList UrlList proto helps users to set reusable, independently manageable lists of hosts, host patterns, URLs, URL patterns.

list_authorization_policies

list_authorization_policies(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authorization_policy.ListAuthorizationPoliciesRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListAuthorizationPoliciesPager
)

Lists AuthorizationPolicies 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_security_v1alpha1

def sample_list_authorization_policies():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListAuthorizationPoliciesRequest(
        parent="parent_value",
    )

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

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

The request object. Request used with the ListAuthorizationPolicies method.

parent str

Required. The project and location from which the AuthorizationPolicies should be listed, specified in the format projects/{project}/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListAuthorizationPoliciesPager Response returned by the ListAuthorizationPolicies method. Iterating over this object will yield results and resolve additional pages automatically.

list_authz_policies

list_authz_policies(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authz_policy.ListAuthzPoliciesRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListAuthzPoliciesPager
)

Lists AuthzPolicies 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_security_v1alpha1

def sample_list_authz_policies():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListAuthzPoliciesRequest(
        parent="parent_value",
    )

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

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

The request object. Message for requesting list of AuthzPolicy resources.

parent str

Required. The project and location from which the AuthzPolicy resources are listed, specified in the following format: projects/{project}/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListAuthzPoliciesPager Message for response to listing AuthzPolicy resources. Iterating over this object will yield results and resolve additional pages automatically.

list_backend_authentication_configs

list_backend_authentication_configs(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.backend_authentication_config.ListBackendAuthenticationConfigsRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListBackendAuthenticationConfigsPager
)

Lists BackendAuthenticationConfigs 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_security_v1alpha1

def sample_list_backend_authentication_configs():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListBackendAuthenticationConfigsRequest(
        parent="parent_value",
    )

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

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

The request object. Request used by the ListBackendAuthenticationConfigs method.

parent str

Required. The project and location from which the BackendAuthenticationConfigs should be listed, specified in the format projects/*/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListBackendAuthenticationConfigsPager Response returned by the ListBackendAuthenticationConfigs method. Iterating over this object will yield results and resolve additional pages automatically.

list_client_tls_policies

list_client_tls_policies(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.client_tls_policy.ListClientTlsPoliciesRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListClientTlsPoliciesPager
)

Lists ClientTlsPolicies 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_security_v1alpha1

def sample_list_client_tls_policies():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListClientTlsPoliciesRequest(
        parent="parent_value",
    )

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

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

The request object. Request used by the ListClientTlsPolicies method.

parent str

Required. The project and location from which the ClientTlsPolicies should be listed, specified in the format projects/*/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListClientTlsPoliciesPager Response returned by the ListClientTlsPolicies method. Iterating over this object will yield results and resolve additional pages automatically.

list_gateway_security_policies

list_gateway_security_policies(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy.ListGatewaySecurityPoliciesRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListGatewaySecurityPoliciesPager
)

Lists GatewaySecurityPolicies 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_security_v1alpha1

def sample_list_gateway_security_policies():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListGatewaySecurityPoliciesRequest(
        parent="parent_value",
    )

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

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

The request object. Request used with the ListGatewaySecurityPolicies method.

parent str

Required. The project and location from which the GatewaySecurityPolicies should be listed, specified in the format projects/{project}/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListGatewaySecurityPoliciesPager Response returned by the ListGatewaySecurityPolicies method. Iterating over this object will yield results and resolve additional pages automatically.

list_gateway_security_policy_rules

list_gateway_security_policy_rules(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.ListGatewaySecurityPolicyRulesRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListGatewaySecurityPolicyRulesPager
)

Lists GatewaySecurityPolicyRules 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_security_v1alpha1

def sample_list_gateway_security_policy_rules():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListGatewaySecurityPolicyRulesRequest(
        parent="parent_value",
    )

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

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

The request object. Request used with the ListGatewaySecurityPolicyRules method.

parent str

Required. The project, location and GatewaySecurityPolicy from which the GatewaySecurityPolicyRules should be listed, specified in the format projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListGatewaySecurityPolicyRulesPager Response returned by the ListGatewaySecurityPolicyRules 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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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

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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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

list_server_tls_policies

list_server_tls_policies(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.server_tls_policy.ListServerTlsPoliciesRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListServerTlsPoliciesPager
)

Lists ServerTlsPolicies 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_security_v1alpha1

def sample_list_server_tls_policies():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListServerTlsPoliciesRequest(
        parent="parent_value",
    )

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

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

The request object. Request used by the ListServerTlsPolicies method.

parent str

Required. The project and location from which the ServerTlsPolicies should be listed, specified in the format projects/*/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListServerTlsPoliciesPager Response returned by the ListServerTlsPolicies method. Iterating over this object will yield results and resolve additional pages automatically.

list_tls_inspection_policies

list_tls_inspection_policies(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.tls_inspection_policy.ListTlsInspectionPoliciesRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListTlsInspectionPoliciesPager
)

Lists TlsInspectionPolicies 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_security_v1alpha1

def sample_list_tls_inspection_policies():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListTlsInspectionPoliciesRequest(
        parent="parent_value",
    )

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

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

The request object. Request used with the ListTlsInspectionPolicies method.

parent str

Required. The project and location from which the TlsInspectionPolicies should be listed, specified in the format projects/{project}/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListTlsInspectionPoliciesPager Response returned by the ListTlsInspectionPolicies method. Iterating over this object will yield results and resolve additional pages automatically.

list_url_lists

list_url_lists(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.url_list.ListUrlListsRequest,
            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, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.network_security_v1alpha1.services.network_security.pagers.ListUrlListsPager
)

Lists UrlLists 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_security_v1alpha1

def sample_list_url_lists():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    request = network_security_v1alpha1.ListUrlListsRequest(
        parent="parent_value",
    )

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

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

The request object. Request used by the ListUrlList method.

parent str

Required. The project and location from which the UrlLists should be listed, specified in the format projects/{project}/locations/{location}. 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.network_security_v1alpha1.services.network_security.pagers.ListUrlListsPager Response returned by the ListUrlLists method. Iterating over this object will yield results and resolve additional pages automatically.

parse_authorization_policy_path

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

Parses a authorization_policy path into its component segments.

parse_authz_policy_path

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

Parses a authz_policy path into its component segments.

parse_backend_authentication_config_path

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

Parses a backend_authentication_config path into its component segments.

parse_ca_pool_path

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

Parses a ca_pool path into its component segments.

parse_certificate_path

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

Parses a certificate 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_gateway_security_policy_path

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

Parses a gateway_security_policy path into its component segments.

parse_gateway_security_policy_rule_path

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

Parses a gateway_security_policy_rule 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_tls_inspection_policy_path

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

Parses a tls_inspection_policy path into its component segments.

parse_trust_config_path

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

Parses a trust_config path into its component segments.

parse_url_list_path

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

Parses a url_list 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.

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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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 __.

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, typing.Union[str, bytes]]] = ()
) -> 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

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

tls_inspection_policy_path

tls_inspection_policy_path(
    project: str, location: str, tls_inspection_policy: str
) -> str

Returns a fully-qualified tls_inspection_policy string.

trust_config_path

trust_config_path(project: str, location: str, trust_config: str) -> str

Returns a fully-qualified trust_config string.

update_authorization_policy

update_authorization_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authorization_policy.UpdateAuthorizationPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    authorization_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.authorization_policy.AuthorizationPolicy
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single AuthorizationPolicy.

# 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_security_v1alpha1

def sample_update_authorization_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    authorization_policy = network_security_v1alpha1.AuthorizationPolicy()
    authorization_policy.name = "name_value"
    authorization_policy.action = "DENY"

    request = network_security_v1alpha1.UpdateAuthorizationPolicyRequest(
        authorization_policy=authorization_policy,
    )

    # Make the request
    operation = client.update_authorization_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_security_v1alpha1.types.UpdateAuthorizationPolicyRequest, dict]

The request object. Request used by the UpdateAuthorizationPolicy method.

authorization_policy google.cloud.network_security_v1alpha1.types.AuthorizationPolicy

Required. Updated AuthorizationPolicy resource. This corresponds to the authorization_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 AuthorizationPolicy 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be AuthorizationPolicy AuthorizationPolicy is a resource that specifies how a server should authorize incoming connections. This resource in itself does not change the configuration unless it's attached to a target https proxy or endpoint config selector resource.

update_authz_policy

update_authz_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.authz_policy.UpdateAuthzPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    authz_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.authz_policy.AuthzPolicy
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single AuthzPolicy.

# 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_security_v1alpha1

def sample_update_authz_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    authz_policy = network_security_v1alpha1.AuthzPolicy()
    authz_policy.name = "name_value"
    authz_policy.target.load_balancing_scheme = "INTERNAL_SELF_MANAGED"
    authz_policy.target.resources = ['resources_value1', 'resources_value2']
    authz_policy.action = "CUSTOM"

    request = network_security_v1alpha1.UpdateAuthzPolicyRequest(
        authz_policy=authz_policy,
    )

    # Make the request
    operation = client.update_authz_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_security_v1alpha1.types.UpdateAuthzPolicyRequest, dict]

The request object. Message for updating an AuthzPolicy resource.

authz_policy google.cloud.network_security_v1alpha1.types.AuthzPolicy

Required. AuthzPolicy resource being updated. This corresponds to the authz_policy field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Required. Used to specify the fields to be overwritten in the AuthzPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not specify a mask, then all fields are 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be AuthzPolicy AuthzPolicy is a resource that allows to forward traffic to a callout backend designed to scan the traffic for security purposes.

update_backend_authentication_config

update_backend_authentication_config(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.backend_authentication_config.UpdateBackendAuthenticationConfigRequest,
            dict,
        ]
    ] = None,
    *,
    backend_authentication_config: typing.Optional[
        google.cloud.network_security_v1alpha1.types.backend_authentication_config.BackendAuthenticationConfig
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.

# 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_security_v1alpha1

def sample_update_backend_authentication_config():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    backend_authentication_config = network_security_v1alpha1.BackendAuthenticationConfig()
    backend_authentication_config.name = "name_value"

    request = network_security_v1alpha1.UpdateBackendAuthenticationConfigRequest(
        backend_authentication_config=backend_authentication_config,
    )

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

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

    response = operation.result()

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

The request object. Request used by UpdateBackendAuthenticationConfig method.

backend_authentication_config google.cloud.network_security_v1alpha1.types.BackendAuthenticationConfig

Required. Updated BackendAuthenticationConfig resource. This corresponds to the backend_authentication_config 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 BackendAuthenticationConfig 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be BackendAuthenticationConfig BackendAuthenticationConfig message groups the TrustConfig together with other settings that control how the load balancer authenticates, and expresses its identity to, the backend: - trustConfig is the attached TrustConfig. \* wellKnownRoots indicates whether the load balance should trust backend server certificates that are issued by public certificate authorities, in addition to certificates trusted by the TrustConfig. \* clientCertificate is a client certificate that the load balancer uses to express its identity to the backend, if the connection to the backend uses mTLS. You can attach the BackendAuthenticationConfig to the load balancer's BackendService directly determining how that BackendService negotiates TLS.

update_client_tls_policy

update_client_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.client_tls_policy.UpdateClientTlsPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    client_tls_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.client_tls_policy.ClientTlsPolicy
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single ClientTlsPolicy.

# 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_security_v1alpha1

def sample_update_client_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    client_tls_policy = network_security_v1alpha1.ClientTlsPolicy()
    client_tls_policy.name = "name_value"

    request = network_security_v1alpha1.UpdateClientTlsPolicyRequest(
        client_tls_policy=client_tls_policy,
    )

    # Make the request
    operation = client.update_client_tls_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_security_v1alpha1.types.UpdateClientTlsPolicyRequest, dict]

The request object. Request used by UpdateClientTlsPolicy method.

client_tls_policy google.cloud.network_security_v1alpha1.types.ClientTlsPolicy

Required. Updated ClientTlsPolicy resource. This corresponds to the client_tls_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 ClientTlsPolicy 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be ClientTlsPolicy ClientTlsPolicy is a resource that specifies how a client should authenticate connections to backends of a service. This resource itself does not affect configuration unless it is attached to a backend service resource.

update_gateway_security_policy

update_gateway_security_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy.UpdateGatewaySecurityPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    gateway_security_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.gateway_security_policy.GatewaySecurityPolicy
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single GatewaySecurityPolicy.

# 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_security_v1alpha1

def sample_update_gateway_security_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    gateway_security_policy = network_security_v1alpha1.GatewaySecurityPolicy()
    gateway_security_policy.name = "name_value"

    request = network_security_v1alpha1.UpdateGatewaySecurityPolicyRequest(
        gateway_security_policy=gateway_security_policy,
    )

    # Make the request
    operation = client.update_gateway_security_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_security_v1alpha1.types.UpdateGatewaySecurityPolicyRequest, dict]

The request object. Request used by the UpdateGatewaySecurityPolicy method.

gateway_security_policy google.cloud.network_security_v1alpha1.types.GatewaySecurityPolicy

Required. Updated GatewaySecurityPolicy resource. This corresponds to the gateway_security_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 GatewaySecurityPolicy 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be GatewaySecurityPolicy The GatewaySecurityPolicy resource contains a collection of GatewaySecurityPolicyRules and associated metadata.

update_gateway_security_policy_rule

update_gateway_security_policy_rule(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.UpdateGatewaySecurityPolicyRuleRequest,
            dict,
        ]
    ] = None,
    *,
    gateway_security_policy_rule: typing.Optional[
        google.cloud.network_security_v1alpha1.types.gateway_security_policy_rule.GatewaySecurityPolicyRule
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single GatewaySecurityPolicyRule.

# 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_security_v1alpha1

def sample_update_gateway_security_policy_rule():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    gateway_security_policy_rule = network_security_v1alpha1.GatewaySecurityPolicyRule()
    gateway_security_policy_rule.basic_profile = "DENY"
    gateway_security_policy_rule.name = "name_value"
    gateway_security_policy_rule.enabled = True
    gateway_security_policy_rule.priority = 898
    gateway_security_policy_rule.session_matcher = "session_matcher_value"

    request = network_security_v1alpha1.UpdateGatewaySecurityPolicyRuleRequest(
        gateway_security_policy_rule=gateway_security_policy_rule,
    )

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

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

    response = operation.result()

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

The request object. Request used by the UpdateGatewaySecurityPolicyRule method.

gateway_security_policy_rule google.cloud.network_security_v1alpha1.types.GatewaySecurityPolicyRule

Required. Updated GatewaySecurityPolicyRule resource. This corresponds to the gateway_security_policy_rule 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 GatewaySecurityPolicy 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be GatewaySecurityPolicyRule The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents a traffic matching condition and associated action to perform.

update_server_tls_policy

update_server_tls_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.server_tls_policy.UpdateServerTlsPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    server_tls_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.server_tls_policy.ServerTlsPolicy
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single ServerTlsPolicy.

# 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_security_v1alpha1

def sample_update_server_tls_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    server_tls_policy = network_security_v1alpha1.ServerTlsPolicy()
    server_tls_policy.name = "name_value"

    request = network_security_v1alpha1.UpdateServerTlsPolicyRequest(
        server_tls_policy=server_tls_policy,
    )

    # Make the request
    operation = client.update_server_tls_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_security_v1alpha1.types.UpdateServerTlsPolicyRequest, dict]

The request object. Request used by UpdateServerTlsPolicy method.

server_tls_policy google.cloud.network_security_v1alpha1.types.ServerTlsPolicy

Required. Updated ServerTlsPolicy resource. This corresponds to the server_tls_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 ServerTlsPolicy 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be ServerTlsPolicy ServerTlsPolicy is a resource that specifies how a server should authenticate incoming requests. This resource itself does not affect configuration unless it is attached to a target HTTPS proxy or endpoint config selector resource. ServerTlsPolicy in the form accepted by Application Load Balancers can be attached only to TargetHttpsProxy with an EXTERNAL, EXTERNAL_MANAGED or INTERNAL_MANAGED load balancing scheme. Traffic Director compatible ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with Traffic Director INTERNAL_SELF_MANAGED load balancing scheme.

update_tls_inspection_policy

update_tls_inspection_policy(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.tls_inspection_policy.UpdateTlsInspectionPolicyRequest,
            dict,
        ]
    ] = None,
    *,
    tls_inspection_policy: typing.Optional[
        google.cloud.network_security_v1alpha1.types.tls_inspection_policy.TlsInspectionPolicy
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single TlsInspectionPolicy.

# 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_security_v1alpha1

def sample_update_tls_inspection_policy():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    tls_inspection_policy = network_security_v1alpha1.TlsInspectionPolicy()
    tls_inspection_policy.name = "name_value"
    tls_inspection_policy.ca_pool = "ca_pool_value"

    request = network_security_v1alpha1.UpdateTlsInspectionPolicyRequest(
        tls_inspection_policy=tls_inspection_policy,
    )

    # Make the request
    operation = client.update_tls_inspection_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_security_v1alpha1.types.UpdateTlsInspectionPolicyRequest, dict]

The request object. Request used by the UpdateTlsInspectionPolicy method.

tls_inspection_policy google.cloud.network_security_v1alpha1.types.TlsInspectionPolicy

Required. Updated TlsInspectionPolicy resource. This corresponds to the tls_inspection_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 TlsInspectionPolicy 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be TlsInspectionPolicy The TlsInspectionPolicy resource contains references to CA pools in Certificate Authority Service and associated metadata.

update_url_list

update_url_list(
    request: typing.Optional[
        typing.Union[
            google.cloud.network_security_v1alpha1.types.url_list.UpdateUrlListRequest,
            dict,
        ]
    ] = None,
    *,
    url_list: typing.Optional[
        google.cloud.network_security_v1alpha1.types.url_list.UrlList
    ] = 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, typing.Union[str, bytes]]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single UrlList.

# 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_security_v1alpha1

def sample_update_url_list():
    # Create a client
    client = network_security_v1alpha1.NetworkSecurityClient()

    # Initialize request argument(s)
    url_list = network_security_v1alpha1.UrlList()
    url_list.name = "name_value"
    url_list.values = ['values_value1', 'values_value2']

    request = network_security_v1alpha1.UpdateUrlListRequest(
        url_list=url_list,
    )

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

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

    response = operation.result()

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

The request object. Request used by UpdateUrlList method.

url_list google.cloud.network_security_v1alpha1.types.UrlList

Required. Updated UrlList resource. This corresponds to the url_list 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 UrlList 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, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be UrlList UrlList proto helps users to set reusable, independently manageable lists of hosts, host patterns, URLs, URL patterns.

url_list_path

url_list_path(project: str, location: str, url_list: str) -> str

Returns a fully-qualified url_list string.