As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Cloud Servicedirectory v1 API

class google.cloud.servicedirectory_v1.types.CreateEndpointRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1.RegistrationService.CreateEndpoint].

parent

Required. The resource name of the service that this endpoint provides.

Type

str

endpoint_id

Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z](?:[-a-z0-9]{0,61}[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Type

str

endpoint

Required. A endpoint with initial fields set.

Type

google.cloud.servicedirectory_v1.types.Endpoint

class google.cloud.servicedirectory_v1.types.CreateNamespaceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1.RegistrationService.CreateNamespace].

parent

Required. The resource name of the project and location the namespace will be created in.

Type

str

namespace_id

Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z](?:[-a-z0-9]{0,61}[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Type

str

namespace

Required. A namespace with initial fields set.

Type

google.cloud.servicedirectory_v1.types.Namespace

class google.cloud.servicedirectory_v1.types.CreateServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.CreateService][google.cloud.servicedirectory.v1.RegistrationService.CreateService].

parent

Required. The resource name of the namespace this service will belong to.

Type

str

service_id

Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z](?:[-a-z0-9]{0,61}[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Type

str

service

Required. A service with initial fields set.

Type

google.cloud.servicedirectory_v1.types.Service

class google.cloud.servicedirectory_v1.types.DeleteEndpointRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1.RegistrationService.DeleteEndpoint].

name

Required. The name of the endpoint to delete.

Type

str

class google.cloud.servicedirectory_v1.types.DeleteNamespaceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1.RegistrationService.DeleteNamespace].

name

Required. The name of the namespace to delete.

Type

str

class google.cloud.servicedirectory_v1.types.DeleteServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.DeleteService][google.cloud.servicedirectory.v1.RegistrationService.DeleteService].

name

Required. The name of the service to delete.

Type

str

class google.cloud.servicedirectory_v1.types.Endpoint(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An individual endpoint that provides a [service][google.cloud.servicedirectory.v1.Service]. The service must already exist to create an endpoint.

name

Immutable. The resource name for the endpoint in the format projects/*/locations/*/namespaces/*/services/*/endpoints/*

Type

str

address

Optional. An IPv4 or IPv6 address. Service Directory will reject bad addresses like: “8.8.8” “8.8.8.8:53” “test:bad:address” “[::1]” “[::1]:8080” Limited to 45 characters.

Type

str

port

Optional. Service Directory will reject values outside of [0, 65535].

Type

int

annotations

Optional. Annotations for the endpoint. This data can be consumed by service clients. Restrictions:

  • The entire annotations dictionary may contain up to 512 characters, spread accoss all key-value pairs. Annotations that goes beyond any these limits will be rejected.

  • Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/). Annotations that fails to meet these requirements will be rejected.

  • The ‘(.)google.com/’ and ‘(.)googleapis.com/’ prefixes are reserved for system annotations managed by Service Directory. If the user tries to write to these keyspaces, those entries will be silently ignored by the system. Note: This field is equivalent to the ‘metadata’ field in the v1beta1 API. They have the same syntax and read/write to the same location in Service Directory.

Type

Sequence[google.cloud.servicedirectory_v1.types.Endpoint.AnnotationsEntry]

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.servicedirectory_v1.types.GetEndpointRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1.RegistrationService.GetEndpoint]. This should not be used to lookup endpoints at runtime. Instead, use the resolve method.

name

Required. The name of the endpoint to get.

Type

str

class google.cloud.servicedirectory_v1.types.GetNamespaceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1.RegistrationService.GetNamespace].

name

Required. The name of the namespace to retrieve.

Type

str

class google.cloud.servicedirectory_v1.types.GetServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1.RegistrationService.GetService]. This should not be used for looking up a service. Insead, use the resolve method as it will contain all endpoints and associated metadata.

name

Required. The name of the service to get.

Type

str

class google.cloud.servicedirectory_v1.types.ListEndpointsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints].

parent

Required. The resource name of the service whose endpoints we’d like to list.

Type

str

page_size

Optional. The maximum number of items to return.

Type

int

page_token

Optional. The next_page_token value returned from a previous List request, if any.

Type

str

filter

Optional. The filter to list result by.

General filter string syntax: () can be “name”, “address”, “port” or “metadata.” for map field. can be “<, >, <=, >=, !=, =, :”. Of which “:” means HAS, and is roughly the same as “=”. must be the same data type as field. can be “AND, OR, NOT”.

Examples of valid filters:

  • “metadata.owner” returns Endpoints that have a label with the key “owner” this is the same as “metadata:owner”.

  • “metadata.protocol=gRPC” returns Endpoints that have key/value “protocol=gRPC”.

  • “address=192.108.1.105” returns Endpoints that have this address.

  • “port>8080” returns Endpoints that have port number larger than 8080.

  • “name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c” returns Endpoints that have name that is alphabetically later than the string, so “endpoint-e” will be returned but “endpoint-a” will not be.

  • “metadata.owner!=sd AND metadata.foo=bar” returns Endpoints that have “owner” in label key but value is not “sd” AND have key/value foo=bar.

  • “doesnotexist.foo=bar” returns an empty list. Note that Endpoint doesn’t have a field called “doesnotexist”. Since the filter does not match any Endpoints, it returns no results.

Type

str

order_by

Optional. The order to list result by.

Type

str

class google.cloud.servicedirectory_v1.types.ListEndpointsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The response message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints].

endpoints

The list of endpoints.

Type

Sequence[google.cloud.servicedirectory_v1.types.Endpoint]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

property raw_page
class google.cloud.servicedirectory_v1.types.ListNamespacesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1.RegistrationService.ListNamespaces].

parent

Required. The resource name of the project and location whose namespaces we’d like to list.

Type

str

page_size

Optional. The maximum number of items to return.

Type

int

page_token

Optional. The next_page_token value returned from a previous List request, if any.

Type

str

filter

Optional. The filter to list result by.

General filter string syntax: () can be “name”, or “labels.” for map field. can be “<, >, <=, >=, !=, =, :”. Of which “:” means HAS, and is roughly the same as “=”. must be the same data type as field. can be “AND, OR, NOT”.

Examples of valid filters:

  • “labels.owner” returns Namespaces that have a label with the key “owner” this is the same as “labels:owner”.

  • “labels.protocol=gRPC” returns Namespaces that have key/value “protocol=gRPC”.

  • “name>projects/my-project/locations/us-east/namespaces/namespace-c” returns Namespaces that have name that is alphabetically later than the string, so “namespace-e” will be returned but “namespace-a” will not be.

  • “labels.owner!=sd AND labels.foo=bar” returns Namespaces that have “owner” in label key but value is not “sd” AND have key/value foo=bar.

  • “doesnotexist.foo=bar” returns an empty list. Note that Namespace doesn’t have a field called “doesnotexist”. Since the filter does not match any Namespaces, it returns no results.

Type

str

order_by

Optional. The order to list result by.

General order by string syntax: (<asc|desc>) (,) allows values {“name”} <asc/desc> ascending or descending order by . If this is left blank, “asc” is used. Note that an empty order_by string result in default order, which is order by name in ascending order.

Type

str

class google.cloud.servicedirectory_v1.types.ListNamespacesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The response message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1.RegistrationService.ListNamespaces].

namespaces

The list of namespaces.

Type

Sequence[google.cloud.servicedirectory_v1.types.Namespace]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

property raw_page
class google.cloud.servicedirectory_v1.types.ListServicesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1.RegistrationService.ListServices].

parent

Required. The resource name of the namespace whose services we’d like to list.

Type

str

page_size

Optional. The maximum number of items to return.

Type

int

page_token

Optional. The next_page_token value returned from a previous List request, if any.

Type

str

filter

Optional. The filter to list result by.

General filter string syntax: () can be “name”, or “metadata.” for map field. can be “<, >, <=, >=, !=, =, :”. Of which “:” means HAS, and is roughly the same as “=”. must be the same data type as field. can be “AND, OR, NOT”.

Examples of valid filters:

  • “metadata.owner” returns Services that have a label with the key “owner” this is the same as “metadata:owner”.

  • “metadata.protocol=gRPC” returns Services that have key/value “protocol=gRPC”.

  • “name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c” returns Services that have name that is alphabetically later than the string, so “service-e” will be returned but “service-a” will not be.

  • “metadata.owner!=sd AND metadata.foo=bar” returns Services that have “owner” in label key but value is not “sd” AND have key/value foo=bar.

  • “doesnotexist.foo=bar” returns an empty list. Note that Service doesn’t have a field called “doesnotexist”. Since the filter does not match any Services, it returns no results.

Type

str

order_by

Optional. The order to list result by.

Type

str

class google.cloud.servicedirectory_v1.types.ListServicesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The response message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1.RegistrationService.ListServices].

services

The list of services.

Type

Sequence[google.cloud.servicedirectory_v1.types.Service]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

property raw_page
class google.cloud.servicedirectory_v1.types.Namespace(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A container for [services][google.cloud.servicedirectory.v1.Service]. Namespaces allow administrators to group services together and define permissions for a collection of services.

name

Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/*

Type

str

labels

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

Type

Sequence[google.cloud.servicedirectory_v1.types.Namespace.LabelsEntry]

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.servicedirectory_v1.types.ResolveServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. Looks up a service by its name, returns the service and its endpoints.

name

Required. The name of the service to resolve.

Type

str

max_endpoints

Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. If a value less than one is specified, the Default is used. If a value greater than the Maximum is specified, the Maximum is used.

Type

int

endpoint_filter

Optional. The filter applied to the endpoints of the resolved service.

General filter string syntax: () can be “name” or “metadata.” for map field. can be “<, >, <=, >=, !=, =, :”. Of which “:” means HAS and is roughly the same as “=”. must be the same data type as the field. can be “AND, OR, NOT”.

Examples of valid filters:

  • “metadata.owner” returns Endpoints that have a label with the key “owner”, this is the same as “metadata:owner”

  • “metadata.protocol=gRPC” returns Endpoints that have key/value “protocol=gRPC”

  • “metadata.owner!=sd AND metadata.foo=bar” returns Endpoints that have “owner” field in metadata with a value that is not “sd” AND have the key/value foo=bar.

Type

str

class google.cloud.servicedirectory_v1.types.ResolveServiceResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The response message for [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService].

service
Type

google.cloud.servicedirectory_v1.types.Service

class google.cloud.servicedirectory_v1.types.Service(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An individual service. A service contains a name and optional metadata. A service must exist before [endpoints][google.cloud.servicedirectory.v1.Endpoint] can be added to it.

name

Immutable. The resource name for the service in the format projects/*/locations/*/namespaces/*/services/*

Type

str

annotations

Optional. Annotations for the service. This data can be consumed by service clients. Restrictions:

  • The entire annotations dictionary may contain up to 2000 characters, spread accoss all key-value pairs. Annotations that goes beyond any these limits will be rejected.

  • Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/). Annotations that fails to meet these requirements will be rejected.

  • The ‘(.)google.com/’ and ‘(.)googleapis.com/’ prefixes are reserved for system annotations managed by Service Directory. If the user tries to write to these keyspaces, those entries will be silently ignored by the system. Note: This field is equivalent to the ‘metadata’ field in the v1beta1 API. They have the same syntax and read/write to the same location in Service Directory.

Type

Sequence[google.cloud.servicedirectory_v1.types.Service.AnnotationsEntry]

endpoints

Output only. Endpoints associated with this service. Returned on LookupService.Resolve. Control plane clients should use RegistrationService.ListEndpoints.

Type

Sequence[google.cloud.servicedirectory_v1.types.Endpoint]

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.servicedirectory_v1.types.UpdateEndpointRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1.RegistrationService.UpdateEndpoint].

endpoint

Required. The updated endpoint.

Type

google.cloud.servicedirectory_v1.types.Endpoint

update_mask

Required. List of fields to be updated in this request.

Type

google.protobuf.field_mask_pb2.FieldMask

class google.cloud.servicedirectory_v1.types.UpdateNamespaceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1.RegistrationService.UpdateNamespace].

namespace

Required. The updated namespace.

Type

google.cloud.servicedirectory_v1.types.Namespace

update_mask

Required. List of fields to be updated in this request.

Type

google.protobuf.field_mask_pb2.FieldMask

class google.cloud.servicedirectory_v1.types.UpdateServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for [RegistrationService.UpdateService][google.cloud.servicedirectory.v1.RegistrationService.UpdateService].

service

Required. The updated service.

Type

google.cloud.servicedirectory_v1.types.Service

update_mask

Required. List of fields to be updated in this request.

Type

google.protobuf.field_mask_pb2.FieldMask