Class ApiHubGrpc.ApiHubFutureStub (0.1.0)

public static final class ApiHubGrpc.ApiHubFutureStub extends AbstractFutureStub<ApiHubGrpc.ApiHubFutureStub>

A stub to allow clients to do ListenableFuture-style rpc calls to service ApiHub.

This service provides all methods related to the API hub.

Inheritance

java.lang.Object > io.grpc.stub.AbstractStub > io.grpc.stub.AbstractFutureStub > ApiHubGrpc.ApiHubFutureStub

Methods

build(Channel channel, CallOptions callOptions)

protected ApiHubGrpc.ApiHubFutureStub build(Channel channel, CallOptions callOptions)
Parameters
Name Description
channel io.grpc.Channel
callOptions io.grpc.CallOptions
Returns
Type Description
ApiHubGrpc.ApiHubFutureStub
Overrides
io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)

createApi(CreateApiRequest request)

public ListenableFuture<Api> createApi(CreateApiRequest request)

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

Parameter
Name Description
request CreateApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Api>

createAttribute(CreateAttributeRequest request)

public ListenableFuture<Attribute> createAttribute(CreateAttributeRequest request)

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.

Parameter
Name Description
request CreateAttributeRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Attribute>

createDeployment(CreateDeploymentRequest request)

public ListenableFuture<Deployment> createDeployment(CreateDeploymentRequest request)

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

Parameter
Name Description
request CreateDeploymentRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Deployment>

createExternalApi(CreateExternalApiRequest request)

public ListenableFuture<ExternalApi> createExternalApi(CreateExternalApiRequest request)

Create an External API resource in the API hub.

Parameter
Name Description
request CreateExternalApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ExternalApi>

createSpec(CreateSpecRequest request)

public ListenableFuture<Spec> createSpec(CreateSpecRequest request)

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.

Parameter
Name Description
request CreateSpecRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Spec>

createVersion(CreateVersionRequest request)

public ListenableFuture<Version> createVersion(CreateVersionRequest request)

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

Parameter
Name Description
request CreateVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Version>

deleteApi(DeleteApiRequest request)

public ListenableFuture<Empty> deleteApi(DeleteApiRequest request)

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

Parameter
Name Description
request DeleteApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Empty>

deleteAttribute(DeleteAttributeRequest request)

public ListenableFuture<Empty> deleteAttribute(DeleteAttributeRequest request)

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.

Parameter
Name Description
request DeleteAttributeRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Empty>

deleteDeployment(DeleteDeploymentRequest request)

public ListenableFuture<Empty> deleteDeployment(DeleteDeploymentRequest request)

Delete a deployment resource in the API hub.

Parameter
Name Description
request DeleteDeploymentRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Empty>

deleteExternalApi(DeleteExternalApiRequest request)

public ListenableFuture<Empty> deleteExternalApi(DeleteExternalApiRequest request)

Delete an External API resource in the API hub.

Parameter
Name Description
request DeleteExternalApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Empty>

deleteSpec(DeleteSpecRequest request)

public ListenableFuture<Empty> deleteSpec(DeleteSpecRequest request)

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

Parameter
Name Description
request DeleteSpecRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Empty>

deleteVersion(DeleteVersionRequest request)

public ListenableFuture<Empty> deleteVersion(DeleteVersionRequest request)

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

Parameter
Name Description
request DeleteVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Empty>

getApi(GetApiRequest request)

public ListenableFuture<Api> getApi(GetApiRequest request)

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

Parameter
Name Description
request GetApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Api>

getApiOperation(GetApiOperationRequest request)

public ListenableFuture<ApiOperation> getApiOperation(GetApiOperationRequest request)

Get details about a particular operation in API version.

Parameter
Name Description
request GetApiOperationRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ApiOperation>

getAttribute(GetAttributeRequest request)

public ListenableFuture<Attribute> getAttribute(GetAttributeRequest request)

Get details about the attribute.

Parameter
Name Description
request GetAttributeRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Attribute>

getDefinition(GetDefinitionRequest request)

public ListenableFuture<Definition> getDefinition(GetDefinitionRequest request)

Get details about a definition in an API version.

Parameter
Name Description
request GetDefinitionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Definition>

getDeployment(GetDeploymentRequest request)

public ListenableFuture<Deployment> getDeployment(GetDeploymentRequest request)

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

Parameter
Name Description
request GetDeploymentRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Deployment>

getExternalApi(GetExternalApiRequest request)

public ListenableFuture<ExternalApi> getExternalApi(GetExternalApiRequest request)

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

Parameter
Name Description
request GetExternalApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ExternalApi>

getSpec(GetSpecRequest request)

public ListenableFuture<Spec> getSpec(GetSpecRequest request)

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.

Parameter
Name Description
request GetSpecRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Spec>

getSpecContents(GetSpecContentsRequest request)

public ListenableFuture<SpecContents> getSpecContents(GetSpecContentsRequest request)

Get spec contents.

Parameter
Name Description
request GetSpecContentsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<SpecContents>

getVersion(GetVersionRequest request)

public ListenableFuture<Version> getVersion(GetVersionRequest request)

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.

Parameter
Name Description
request GetVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Version>

listApiOperations(ListApiOperationsRequest request)

public ListenableFuture<ListApiOperationsResponse> listApiOperations(ListApiOperationsRequest request)

List operations in an API version.

Parameter
Name Description
request ListApiOperationsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListApiOperationsResponse>

listApis(ListApisRequest request)

public ListenableFuture<ListApisResponse> listApis(ListApisRequest request)

List API resources in the API hub.

Parameter
Name Description
request ListApisRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListApisResponse>

listAttributes(ListAttributesRequest request)

public ListenableFuture<ListAttributesResponse> listAttributes(ListAttributesRequest request)

List all attributes.

Parameter
Name Description
request ListAttributesRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListAttributesResponse>

listDeployments(ListDeploymentsRequest request)

public ListenableFuture<ListDeploymentsResponse> listDeployments(ListDeploymentsRequest request)

List deployment resources in the API hub.

Parameter
Name Description
request ListDeploymentsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListDeploymentsResponse>

listExternalApis(ListExternalApisRequest request)

public ListenableFuture<ListExternalApisResponse> listExternalApis(ListExternalApisRequest request)

List External API resources in the API hub.

Parameter
Name Description
request ListExternalApisRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListExternalApisResponse>

listSpecs(ListSpecsRequest request)

public ListenableFuture<ListSpecsResponse> listSpecs(ListSpecsRequest request)

List specs corresponding to a particular API resource.

Parameter
Name Description
request ListSpecsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListSpecsResponse>

listVersions(ListVersionsRequest request)

public ListenableFuture<ListVersionsResponse> listVersions(ListVersionsRequest request)

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

Parameter
Name Description
request ListVersionsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListVersionsResponse>

searchResources(SearchResourcesRequest request)

public ListenableFuture<SearchResourcesResponse> searchResources(SearchResourcesRequest request)

Search across API-Hub resources.

Parameter
Name Description
request SearchResourcesRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<SearchResourcesResponse>

updateApi(UpdateApiRequest request)

public ListenableFuture<Api> updateApi(UpdateApiRequest request)

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.
Parameter
Name Description
request UpdateApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Api>

updateAttribute(UpdateAttributeRequest request)

public ListenableFuture<Attribute> updateAttribute(UpdateAttributeRequest request)

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.
Parameter
Name Description
request UpdateAttributeRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Attribute>

updateDeployment(UpdateDeploymentRequest request)

public ListenableFuture<Deployment> updateDeployment(UpdateDeploymentRequest request)

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.
Parameter
Name Description
request UpdateDeploymentRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Deployment>

updateExternalApi(UpdateExternalApiRequest request)

public ListenableFuture<ExternalApi> updateExternalApi(UpdateExternalApiRequest request)

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.
Parameter
Name Description
request UpdateExternalApiRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ExternalApi>

updateSpec(UpdateSpecRequest request)

public ListenableFuture<Spec> updateSpec(UpdateSpecRequest request)

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.
Parameter
Name Description
request UpdateSpecRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Spec>

updateVersion(UpdateVersionRequest request)

public ListenableFuture<Version> updateVersion(UpdateVersionRequest request)

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.
Parameter
Name Description
request UpdateVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<Version>