[BindServiceMethod(typeof(ApiHub), "BindService")]
public abstract class ApiHub.ApiHubBase
Reference documentation and code samples for the API hub v1 API class ApiHub.ApiHubBase.
Base class for server-side implementations of ApiHub
Namespace
Google.Cloud.ApiHub.V1Assembly
Google.Cloud.ApiHub.V1.dll
Methods
CreateApi(CreateApiRequest, ServerCallContext)
public virtual Task<Api> CreateApi(CreateApiRequest request, ServerCallContext context)
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 The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskApi |
The response to send back to the client (wrapped by a task). |
CreateAttribute(CreateAttributeRequest, ServerCallContext)
public virtual Task<Attribute> CreateAttribute(CreateAttributeRequest request, ServerCallContext context)
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][google.cloud.apihub.v1.ApiHub.ListAttributes] method.
Allowed values for the same can be updated via
[UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.
Parameters | |
---|---|
Name | Description |
request |
CreateAttributeRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttribute |
The response to send back to the client (wrapped by a task). |
CreateDeployment(CreateDeploymentRequest, ServerCallContext)
public virtual Task<Deployment> CreateDeployment(CreateDeploymentRequest request, ServerCallContext context)
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 The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskDeployment |
The response to send back to the client (wrapped by a task). |
CreateExternalApi(CreateExternalApiRequest, ServerCallContext)
public virtual Task<ExternalApi> CreateExternalApi(CreateExternalApiRequest request, ServerCallContext context)
Create an External API resource in the API hub.
Parameters | |
---|---|
Name | Description |
request |
CreateExternalApiRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskExternalApi |
The response to send back to the client (wrapped by a task). |
CreateSpec(CreateSpecRequest, ServerCallContext)
public virtual Task<Spec> CreateSpec(CreateSpecRequest request, ServerCallContext context)
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][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.
Parameters | |
---|---|
Name | Description |
request |
CreateSpecRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskSpec |
The response to send back to the client (wrapped by a task). |
CreateVersion(CreateVersionRequest, ServerCallContext)
public virtual Task<Version> CreateVersion(CreateVersionRequest request, ServerCallContext context)
Create an API version for an API resource in the API hub.
Parameters | |
---|---|
Name | Description |
request |
CreateVersionRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskVersion |
The response to send back to the client (wrapped by a task). |
DeleteApi(DeleteApiRequest, ServerCallContext)
public virtual Task<Empty> DeleteApi(DeleteApiRequest request, ServerCallContext context)
Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.
Parameters | |
---|---|
Name | Description |
request |
DeleteApiRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskEmpty |
The response to send back to the client (wrapped by a task). |
DeleteAttribute(DeleteAttributeRequest, ServerCallContext)
public virtual Task<Empty> DeleteAttribute(DeleteAttributeRequest request, ServerCallContext context)
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 The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskEmpty |
The response to send back to the client (wrapped by a task). |
DeleteDeployment(DeleteDeploymentRequest, ServerCallContext)
public virtual Task<Empty> DeleteDeployment(DeleteDeploymentRequest request, ServerCallContext context)
Delete a deployment resource in the API hub.
Parameters | |
---|---|
Name | Description |
request |
DeleteDeploymentRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskEmpty |
The response to send back to the client (wrapped by a task). |
DeleteExternalApi(DeleteExternalApiRequest, ServerCallContext)
public virtual Task<Empty> DeleteExternalApi(DeleteExternalApiRequest request, ServerCallContext context)
Delete an External API resource in the API hub.
Parameters | |
---|---|
Name | Description |
request |
DeleteExternalApiRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskEmpty |
The response to send back to the client (wrapped by a task). |
DeleteSpec(DeleteSpecRequest, ServerCallContext)
public virtual Task<Empty> DeleteSpec(DeleteSpecRequest request, ServerCallContext context)
Delete a spec. Deleting a spec will also delete the associated operations from the version.
Parameters | |
---|---|
Name | Description |
request |
DeleteSpecRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskEmpty |
The response to send back to the client (wrapped by a task). |
DeleteVersion(DeleteVersionRequest, ServerCallContext)
public virtual Task<Empty> DeleteVersion(DeleteVersionRequest request, ServerCallContext context)
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 The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskEmpty |
The response to send back to the client (wrapped by a task). |
GetApi(GetApiRequest, ServerCallContext)
public virtual Task<Api> GetApi(GetApiRequest request, ServerCallContext context)
Get API resource details including the API versions contained in it.
Parameters | |
---|---|
Name | Description |
request |
GetApiRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskApi |
The response to send back to the client (wrapped by a task). |
GetApiOperation(GetApiOperationRequest, ServerCallContext)
public virtual Task<ApiOperation> GetApiOperation(GetApiOperationRequest request, ServerCallContext context)
Get details about a particular operation in API version.
Parameters | |
---|---|
Name | Description |
request |
GetApiOperationRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskApiOperation |
The response to send back to the client (wrapped by a task). |
GetAttribute(GetAttributeRequest, ServerCallContext)
public virtual Task<Attribute> GetAttribute(GetAttributeRequest request, ServerCallContext context)
Get details about the attribute.
Parameters | |
---|---|
Name | Description |
request |
GetAttributeRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttribute |
The response to send back to the client (wrapped by a task). |
GetDefinition(GetDefinitionRequest, ServerCallContext)
public virtual Task<Definition> GetDefinition(GetDefinitionRequest request, ServerCallContext context)
Get details about a definition in an API version.
Parameters | |
---|---|
Name | Description |
request |
GetDefinitionRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskDefinition |
The response to send back to the client (wrapped by a task). |
GetDeployment(GetDeploymentRequest, ServerCallContext)
public virtual Task<Deployment> GetDeployment(GetDeploymentRequest request, ServerCallContext context)
Get details about a deployment and the API versions linked to it.
Parameters | |
---|---|
Name | Description |
request |
GetDeploymentRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskDeployment |
The response to send back to the client (wrapped by a task). |
GetExternalApi(GetExternalApiRequest, ServerCallContext)
public virtual Task<ExternalApi> GetExternalApi(GetExternalApiRequest request, ServerCallContext context)
Get details about an External API resource in the API hub.
Parameters | |
---|---|
Name | Description |
request |
GetExternalApiRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskExternalApi |
The response to send back to the client (wrapped by a task). |
GetSpec(GetSpecRequest, ServerCallContext)
public virtual Task<Spec> GetSpec(GetSpecRequest request, ServerCallContext context)
Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.
Parameters | |
---|---|
Name | Description |
request |
GetSpecRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskSpec |
The response to send back to the client (wrapped by a task). |
GetSpecContents(GetSpecContentsRequest, ServerCallContext)
public virtual Task<SpecContents> GetSpecContents(GetSpecContentsRequest request, ServerCallContext context)
Get spec contents.
Parameters | |
---|---|
Name | Description |
request |
GetSpecContentsRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskSpecContents |
The response to send back to the client (wrapped by a task). |
GetVersion(GetVersionRequest, ServerCallContext)
public virtual Task<Version> GetVersion(GetVersionRequest request, ServerCallContext context)
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 The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskVersion |
The response to send back to the client (wrapped by a task). |
ListApiOperations(ListApiOperationsRequest, ServerCallContext)
public virtual Task<ListApiOperationsResponse> ListApiOperations(ListApiOperationsRequest request, ServerCallContext context)
List operations in an API version.
Parameters | |
---|---|
Name | Description |
request |
ListApiOperationsRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListApiOperationsResponse |
The response to send back to the client (wrapped by a task). |
ListApis(ListApisRequest, ServerCallContext)
public virtual Task<ListApisResponse> ListApis(ListApisRequest request, ServerCallContext context)
List API resources in the API hub.
Parameters | |
---|---|
Name | Description |
request |
ListApisRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListApisResponse |
The response to send back to the client (wrapped by a task). |
ListAttributes(ListAttributesRequest, ServerCallContext)
public virtual Task<ListAttributesResponse> ListAttributes(ListAttributesRequest request, ServerCallContext context)
List all attributes.
Parameters | |
---|---|
Name | Description |
request |
ListAttributesRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListAttributesResponse |
The response to send back to the client (wrapped by a task). |
ListDeployments(ListDeploymentsRequest, ServerCallContext)
public virtual Task<ListDeploymentsResponse> ListDeployments(ListDeploymentsRequest request, ServerCallContext context)
List deployment resources in the API hub.
Parameters | |
---|---|
Name | Description |
request |
ListDeploymentsRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListDeploymentsResponse |
The response to send back to the client (wrapped by a task). |
ListExternalApis(ListExternalApisRequest, ServerCallContext)
public virtual Task<ListExternalApisResponse> ListExternalApis(ListExternalApisRequest request, ServerCallContext context)
List External API resources in the API hub.
Parameters | |
---|---|
Name | Description |
request |
ListExternalApisRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListExternalApisResponse |
The response to send back to the client (wrapped by a task). |
ListSpecs(ListSpecsRequest, ServerCallContext)
public virtual Task<ListSpecsResponse> ListSpecs(ListSpecsRequest request, ServerCallContext context)
List specs corresponding to a particular API resource.
Parameters | |
---|---|
Name | Description |
request |
ListSpecsRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListSpecsResponse |
The response to send back to the client (wrapped by a task). |
ListVersions(ListVersionsRequest, ServerCallContext)
public virtual Task<ListVersionsResponse> ListVersions(ListVersionsRequest request, ServerCallContext context)
List API versions of an API resource in the API hub.
Parameters | |
---|---|
Name | Description |
request |
ListVersionsRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListVersionsResponse |
The response to send back to the client (wrapped by a task). |
SearchResources(SearchResourcesRequest, ServerCallContext)
public virtual Task<SearchResourcesResponse> SearchResources(SearchResourcesRequest request, ServerCallContext context)
Search across API-Hub resources.
Parameters | |
---|---|
Name | Description |
request |
SearchResourcesRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskSearchResourcesResponse |
The response to send back to the client (wrapped by a task). |
UpdateApi(UpdateApiRequest, ServerCallContext)
public virtual Task<Api> UpdateApi(UpdateApiRequest request, ServerCallContext context)
Update an API resource in the API hub. The following fields in the [API][] can be updated:
- [display_name][google.cloud.apihub.v1.Api.display_name]
- [description][google.cloud.apihub.v1.Api.description]
- [owner][google.cloud.apihub.v1.Api.owner]
- [documentation][google.cloud.apihub.v1.Api.documentation]
- [target_user][google.cloud.apihub.v1.Api.target_user]
- [team][google.cloud.apihub.v1.Api.team]
- [business_unit][google.cloud.apihub.v1.Api.business_unit]
- [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
- [attributes][google.cloud.apihub.v1.Api.attributes]
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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 The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskApi |
The response to send back to the client (wrapped by a task). |
UpdateAttribute(UpdateAttributeRequest, ServerCallContext)
public virtual Task<Attribute> UpdateAttribute(UpdateAttributeRequest request, ServerCallContext context)
Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
- [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only.
- [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only.
- [allowed_values][google.cloud.apihub.v1.Attribute.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][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.
The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.
Parameters | |
---|---|
Name | Description |
request |
UpdateAttributeRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttribute |
The response to send back to the client (wrapped by a task). |
UpdateDeployment(UpdateDeploymentRequest, ServerCallContext)
public virtual Task<Deployment> UpdateDeployment(UpdateDeploymentRequest request, ServerCallContext context)
Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated:
- [display_name][google.cloud.apihub.v1.Deployment.display_name]
- [description][google.cloud.apihub.v1.Deployment.description]
- [documentation][google.cloud.apihub.v1.Deployment.documentation]
- [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
- [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
- [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
- [slo][google.cloud.apihub.v1.Deployment.slo]
- [environment][google.cloud.apihub.v1.Deployment.environment]
- [attributes][google.cloud.apihub.v1.Deployment.attributes]
The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.
Parameters | |
---|---|
Name | Description |
request |
UpdateDeploymentRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskDeployment |
The response to send back to the client (wrapped by a task). |
UpdateExternalApi(UpdateExternalApiRequest, ServerCallContext)
public virtual Task<ExternalApi> UpdateExternalApi(UpdateExternalApiRequest request, ServerCallContext context)
Update an External API resource in the API hub. The following fields can be updated:
- [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
- [description][google.cloud.apihub.v1.ExternalApi.description]
- [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
- [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
- [paths][google.cloud.apihub.v1.ExternalApi.paths]
The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.
Parameters | |
---|---|
Name | Description |
request |
UpdateExternalApiRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskExternalApi |
The response to send back to the client (wrapped by a task). |
UpdateSpec(UpdateSpecRequest, ServerCallContext)
public virtual Task<Spec> UpdateSpec(UpdateSpecRequest request, ServerCallContext context)
Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated:
- [display_name][google.cloud.apihub.v1.Spec.display_name]
- [source_uri][google.cloud.apihub.v1.Spec.source_uri]
- [lint_response][google.cloud.apihub.v1.Spec.lint_response]
- [attributes][google.cloud.apihub.v1.Spec.attributes]
- [contents][google.cloud.apihub.v1.Spec.contents]
- [spec_type][google.cloud.apihub.v1.Spec.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][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.
Parameters | |
---|---|
Name | Description |
request |
UpdateSpecRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskSpec |
The response to send back to the client (wrapped by a task). |
UpdateVersion(UpdateVersionRequest, ServerCallContext)
public virtual Task<Version> UpdateVersion(UpdateVersionRequest request, ServerCallContext context)
Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently:
- [display_name][google.cloud.apihub.v1.Version.display_name]
- [description][google.cloud.apihub.v1.Version.description]
- [documentation][google.cloud.apihub.v1.Version.documentation]
- [deployments][google.cloud.apihub.v1.Version.deployments]
- [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
- [compliance][google.cloud.apihub.v1.Version.compliance]
- [accreditation][google.cloud.apihub.v1.Version.accreditation]
- [attributes][google.cloud.apihub.v1.Version.attributes]
The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.
Parameters | |
---|---|
Name | Description |
request |
UpdateVersionRequest The request received from the client. |
context |
ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskVersion |
The response to send back to the client (wrapped by a task). |