Interface ApiHubGrpc.AsyncService (0.2.0)

public static interface ApiHubGrpc.AsyncService

This service provides all methods related to the API hub.

Methods

createApi(CreateApiRequest request, StreamObserver<Api> responseObserver)

public default void createApi(CreateApiRequest request, StreamObserver<Api> responseObserver)

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

Parameters
Name Description
request CreateApiRequest
responseObserver io.grpc.stub.StreamObserver<Api>

createAttribute(CreateAttributeRequest request, StreamObserver<Attribute> responseObserver)

public default void createAttribute(CreateAttributeRequest request, StreamObserver<Attribute> responseObserver)

Create a user defined attribute. Certain pre defined attributes are already created by the API hub. These attributes will have type as SYSTEM_DEFINED and can be listed via ListAttributes method. Allowed values for the same can be updated via UpdateAttribute method.

Parameters
Name Description
request CreateAttributeRequest
responseObserver io.grpc.stub.StreamObserver<Attribute>

createDeployment(CreateDeploymentRequest request, StreamObserver<Deployment> responseObserver)

public default void createDeployment(CreateDeploymentRequest request, StreamObserver<Deployment> responseObserver)

Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.

Parameters
Name Description
request CreateDeploymentRequest
responseObserver io.grpc.stub.StreamObserver<Deployment>

createExternalApi(CreateExternalApiRequest request, StreamObserver<ExternalApi> responseObserver)

public default void createExternalApi(CreateExternalApiRequest request, StreamObserver<ExternalApi> responseObserver)

Create an External API resource in the API hub.

Parameters
Name Description
request CreateExternalApiRequest
responseObserver io.grpc.stub.StreamObserver<ExternalApi>

createSpec(CreateSpecRequest request, StreamObserver<Spec> responseObserver)

public default void createSpec(CreateSpecRequest request, StreamObserver<Spec> responseObserver)

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided. On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.

Parameters
Name Description
request CreateSpecRequest
responseObserver io.grpc.stub.StreamObserver<Spec>

createVersion(CreateVersionRequest request, StreamObserver<Version> responseObserver)

public default void createVersion(CreateVersionRequest request, StreamObserver<Version> responseObserver)

Create an API version for an API resource in the API hub.

Parameters
Name Description
request CreateVersionRequest
responseObserver io.grpc.stub.StreamObserver<Version>

deleteApi(DeleteApiRequest request, StreamObserver<Empty> responseObserver)

public default void deleteApi(DeleteApiRequest request, StreamObserver<Empty> responseObserver)

Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.

Parameters
Name Description
request DeleteApiRequest
responseObserver io.grpc.stub.StreamObserver<Empty>

deleteAttribute(DeleteAttributeRequest request, StreamObserver<Empty> responseObserver)

public default void deleteAttribute(DeleteAttributeRequest request, StreamObserver<Empty> responseObserver)

Delete an attribute. Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.

Parameters
Name Description
request DeleteAttributeRequest
responseObserver io.grpc.stub.StreamObserver<Empty>

deleteDeployment(DeleteDeploymentRequest request, StreamObserver<Empty> responseObserver)

public default void deleteDeployment(DeleteDeploymentRequest request, StreamObserver<Empty> responseObserver)

Delete a deployment resource in the API hub.

Parameters
Name Description
request DeleteDeploymentRequest
responseObserver io.grpc.stub.StreamObserver<Empty>

deleteExternalApi(DeleteExternalApiRequest request, StreamObserver<Empty> responseObserver)

public default void deleteExternalApi(DeleteExternalApiRequest request, StreamObserver<Empty> responseObserver)

Delete an External API resource in the API hub.

Parameters
Name Description
request DeleteExternalApiRequest
responseObserver io.grpc.stub.StreamObserver<Empty>

deleteSpec(DeleteSpecRequest request, StreamObserver<Empty> responseObserver)

public default void deleteSpec(DeleteSpecRequest request, StreamObserver<Empty> responseObserver)

Delete a spec. Deleting a spec will also delete the associated operations from the version.

Parameters
Name Description
request DeleteSpecRequest
responseObserver io.grpc.stub.StreamObserver<Empty>

deleteVersion(DeleteVersionRequest request, StreamObserver<Empty> responseObserver)

public default void deleteVersion(DeleteVersionRequest request, StreamObserver<Empty> responseObserver)

Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.

Parameters
Name Description
request DeleteVersionRequest
responseObserver io.grpc.stub.StreamObserver<Empty>

getApi(GetApiRequest request, StreamObserver<Api> responseObserver)

public default void getApi(GetApiRequest request, StreamObserver<Api> responseObserver)

Get API resource details including the API versions contained in it.

Parameters
Name Description
request GetApiRequest
responseObserver io.grpc.stub.StreamObserver<Api>

getApiOperation(GetApiOperationRequest request, StreamObserver<ApiOperation> responseObserver)

public default void getApiOperation(GetApiOperationRequest request, StreamObserver<ApiOperation> responseObserver)

Get details about a particular operation in API version.

Parameters
Name Description
request GetApiOperationRequest
responseObserver io.grpc.stub.StreamObserver<ApiOperation>

getAttribute(GetAttributeRequest request, StreamObserver<Attribute> responseObserver)

public default void getAttribute(GetAttributeRequest request, StreamObserver<Attribute> responseObserver)

Get details about the attribute.

Parameters
Name Description
request GetAttributeRequest
responseObserver io.grpc.stub.StreamObserver<Attribute>

getDefinition(GetDefinitionRequest request, StreamObserver<Definition> responseObserver)

public default void getDefinition(GetDefinitionRequest request, StreamObserver<Definition> responseObserver)

Get details about a definition in an API version.

Parameters
Name Description
request GetDefinitionRequest
responseObserver io.grpc.stub.StreamObserver<Definition>

getDeployment(GetDeploymentRequest request, StreamObserver<Deployment> responseObserver)

public default void getDeployment(GetDeploymentRequest request, StreamObserver<Deployment> responseObserver)

Get details about a deployment and the API versions linked to it.

Parameters
Name Description
request GetDeploymentRequest
responseObserver io.grpc.stub.StreamObserver<Deployment>

getExternalApi(GetExternalApiRequest request, StreamObserver<ExternalApi> responseObserver)

public default void getExternalApi(GetExternalApiRequest request, StreamObserver<ExternalApi> responseObserver)

Get details about an External API resource in the API hub.

Parameters
Name Description
request GetExternalApiRequest
responseObserver io.grpc.stub.StreamObserver<ExternalApi>

getSpec(GetSpecRequest request, StreamObserver<Spec> responseObserver)

public default void getSpec(GetSpecRequest request, StreamObserver<Spec> responseObserver)

Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use GetSpecContents method to retrieve the same.

Parameters
Name Description
request GetSpecRequest
responseObserver io.grpc.stub.StreamObserver<Spec>

getSpecContents(GetSpecContentsRequest request, StreamObserver<SpecContents> responseObserver)

public default void getSpecContents(GetSpecContentsRequest request, StreamObserver<SpecContents> responseObserver)

Get spec contents.

Parameters
Name Description
request GetSpecContentsRequest
responseObserver io.grpc.stub.StreamObserver<SpecContents>

getVersion(GetVersionRequest request, StreamObserver<Version> responseObserver)

public default void getVersion(GetVersionRequest request, StreamObserver<Version> responseObserver)

Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.

Parameters
Name Description
request GetVersionRequest
responseObserver io.grpc.stub.StreamObserver<Version>

listApiOperations(ListApiOperationsRequest request, StreamObserver<ListApiOperationsResponse> responseObserver)

public default void listApiOperations(ListApiOperationsRequest request, StreamObserver<ListApiOperationsResponse> responseObserver)

List operations in an API version.

Parameters
Name Description
request ListApiOperationsRequest
responseObserver io.grpc.stub.StreamObserver<ListApiOperationsResponse>

listApis(ListApisRequest request, StreamObserver<ListApisResponse> responseObserver)

public default void listApis(ListApisRequest request, StreamObserver<ListApisResponse> responseObserver)

List API resources in the API hub.

Parameters
Name Description
request ListApisRequest
responseObserver io.grpc.stub.StreamObserver<ListApisResponse>

listAttributes(ListAttributesRequest request, StreamObserver<ListAttributesResponse> responseObserver)

public default void listAttributes(ListAttributesRequest request, StreamObserver<ListAttributesResponse> responseObserver)

List all attributes.

Parameters
Name Description
request ListAttributesRequest
responseObserver io.grpc.stub.StreamObserver<ListAttributesResponse>

listDeployments(ListDeploymentsRequest request, StreamObserver<ListDeploymentsResponse> responseObserver)

public default void listDeployments(ListDeploymentsRequest request, StreamObserver<ListDeploymentsResponse> responseObserver)

List deployment resources in the API hub.

Parameters
Name Description
request ListDeploymentsRequest
responseObserver io.grpc.stub.StreamObserver<ListDeploymentsResponse>

listExternalApis(ListExternalApisRequest request, StreamObserver<ListExternalApisResponse> responseObserver)

public default void listExternalApis(ListExternalApisRequest request, StreamObserver<ListExternalApisResponse> responseObserver)

List External API resources in the API hub.

Parameters
Name Description
request ListExternalApisRequest
responseObserver io.grpc.stub.StreamObserver<ListExternalApisResponse>

listSpecs(ListSpecsRequest request, StreamObserver<ListSpecsResponse> responseObserver)

public default void listSpecs(ListSpecsRequest request, StreamObserver<ListSpecsResponse> responseObserver)

List specs corresponding to a particular API resource.

Parameters
Name Description
request ListSpecsRequest
responseObserver io.grpc.stub.StreamObserver<ListSpecsResponse>

listVersions(ListVersionsRequest request, StreamObserver<ListVersionsResponse> responseObserver)

public default void listVersions(ListVersionsRequest request, StreamObserver<ListVersionsResponse> responseObserver)

List API versions of an API resource in the API hub.

Parameters
Name Description
request ListVersionsRequest
responseObserver io.grpc.stub.StreamObserver<ListVersionsResponse>

searchResources(SearchResourcesRequest request, StreamObserver<SearchResourcesResponse> responseObserver)

public default void searchResources(SearchResourcesRequest request, StreamObserver<SearchResourcesResponse> responseObserver)

Search across API-Hub resources.

Parameters
Name Description
request SearchResourcesRequest
responseObserver io.grpc.stub.StreamObserver<SearchResourcesResponse>

updateApi(UpdateApiRequest request, StreamObserver<Api> responseObserver)

public default void updateApi(UpdateApiRequest request, StreamObserver<Api> responseObserver)

Update an API resource in the API hub. The following fields in the [API][] can be updated:

  • display_name
  • description
  • owner
  • documentation
  • target_user
  • team
  • business_unit
  • maturity_level
  • attributes The update_mask should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields.
Parameters
Name Description
request UpdateApiRequest
responseObserver io.grpc.stub.StreamObserver<Api>

updateAttribute(UpdateAttributeRequest request, StreamObserver<Attribute> responseObserver)

public default void updateAttribute(UpdateAttributeRequest request, StreamObserver<Attribute> responseObserver)

Update the attribute. The following fields in the Attribute resource can be updated:

  • display_name The display name can be updated for user defined attributes only.
  • description The description can be updated for user defined attributes only.
  • allowed_values To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted.
  • cardinality The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. The update_mask should be used to specify the fields being updated.
Parameters
Name Description
request UpdateAttributeRequest
responseObserver io.grpc.stub.StreamObserver<Attribute>

updateDeployment(UpdateDeploymentRequest request, StreamObserver<Deployment> responseObserver)

public default void updateDeployment(UpdateDeploymentRequest request, StreamObserver<Deployment> responseObserver)

Update a deployment resource in the API hub. The following fields in the deployment resource can be updated:

  • display_name
  • description
  • documentation
  • deployment_type
  • resource_uri
  • endpoints
  • slo
  • environment
  • attributes The update_mask should be used to specify the fields being updated.
Parameters
Name Description
request UpdateDeploymentRequest
responseObserver io.grpc.stub.StreamObserver<Deployment>

updateExternalApi(UpdateExternalApiRequest request, StreamObserver<ExternalApi> responseObserver)

public default void updateExternalApi(UpdateExternalApiRequest request, StreamObserver<ExternalApi> responseObserver)

Update an External API resource in the API hub. The following fields can be updated:

  • display_name
  • description
  • documentation
  • endpoints
  • paths The update_mask should be used to specify the fields being updated.
Parameters
Name Description
request UpdateExternalApiRequest
responseObserver io.grpc.stub.StreamObserver<ExternalApi>

updateSpec(UpdateSpecRequest request, StreamObserver<Spec> responseObserver)

public default void updateSpec(UpdateSpecRequest request, StreamObserver<Spec> responseObserver)

Update spec. The following fields in the spec can be updated:

  • display_name
  • source_uri
  • lint_response
  • attributes
  • contents
  • spec_type In case of an OAS spec, updating spec contents can lead to:
  • Creation, deletion and update of operations.
  • Creation, deletion and update of definitions.
  • Update of other info parsed out from the new spec. In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. The update_mask should be used to specify the fields being updated.
Parameters
Name Description
request UpdateSpecRequest
responseObserver io.grpc.stub.StreamObserver<Spec>

updateVersion(UpdateVersionRequest request, StreamObserver<Version> responseObserver)

public default void updateVersion(UpdateVersionRequest request, StreamObserver<Version> responseObserver)

Update API version. The following fields in the version can be updated currently:

  • display_name
  • description
  • documentation
  • deployments
  • lifecycle
  • compliance
  • accreditation
  • attributes The update_mask should be used to specify the fields being updated.
Parameters
Name Description
request UpdateVersionRequest
responseObserver io.grpc.stub.StreamObserver<Version>