Documentation ¶
Overview ¶
General documentation
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
Example usage ¶
To get started with this package, create a client.
ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client.
ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApisRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApisRequest. } it := c.ListApis(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Use of Context ¶
The ctx passed to NewRegistryClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type AdminCallOptions
- type AdminClient
- func (c *AdminClient) Close() error
- func (c *AdminClient) Connection() *grpc.ClientConndeprecated
- func (c *AdminClient) CreateProject(ctx context.Context, req *rpcpb.CreateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
- func (c *AdminClient) DeleteProject(ctx context.Context, req *rpcpb.DeleteProjectRequest, opts ...gax.CallOption) error
- func (c *AdminClient) GetProject(ctx context.Context, req *rpcpb.GetProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
- func (c *AdminClient) GetStatus(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*rpcpb.Status, error)
- func (c *AdminClient) GetStorage(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*rpcpb.Storage, error)
- func (c *AdminClient) GrpcClient() rpcpb.AdminClient
- func (c *AdminClient) ListProjects(ctx context.Context, req *rpcpb.ListProjectsRequest, opts ...gax.CallOption) *ProjectIterator
- func (c *AdminClient) MigrateDatabase(ctx context.Context, req *rpcpb.MigrateDatabaseRequest, opts ...gax.CallOption) (*MigrateDatabaseOperation, error)
- func (c *AdminClient) MigrateDatabaseOperation(name string) *MigrateDatabaseOperation
- func (c *AdminClient) UpdateProject(ctx context.Context, req *rpcpb.UpdateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
- type ApiDeploymentIterator
- type ApiIterator
- type ApiSpecIterator
- type ApiVersionIterator
- type ArtifactIterator
- type CreateInstanceOperation
- func (op *CreateInstanceOperation) Done() bool
- func (op *CreateInstanceOperation) Metadata() (*rpcpb.OperationMetadata, error)
- func (op *CreateInstanceOperation) Name() string
- func (op *CreateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rpcpb.Instance, error)
- func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rpcpb.Instance, error)
- type DeleteInstanceOperation
- func (op *DeleteInstanceOperation) Done() bool
- func (op *DeleteInstanceOperation) Metadata() (*rpcpb.OperationMetadata, error)
- func (op *DeleteInstanceOperation) Name() string
- func (op *DeleteInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type MigrateDatabaseOperation
- func (op *MigrateDatabaseOperation) Done() bool
- func (op *MigrateDatabaseOperation) Metadata() (*rpcpb.MigrateDatabaseMetadata, error)
- func (op *MigrateDatabaseOperation) Name() string
- func (op *MigrateDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rpcpb.MigrateDatabaseResponse, error)
- func (op *MigrateDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rpcpb.MigrateDatabaseResponse, error)
- type ProjectIterator
- type ProvisioningCallOptions
- type ProvisioningClient
- func (c *ProvisioningClient) Close() error
- func (c *ProvisioningClient) Connection() *grpc.ClientConndeprecated
- func (c *ProvisioningClient) CreateInstance(ctx context.Context, req *rpcpb.CreateInstanceRequest, opts ...gax.CallOption) (*CreateInstanceOperation, error)
- func (c *ProvisioningClient) CreateInstanceOperation(name string) *CreateInstanceOperation
- func (c *ProvisioningClient) DeleteInstance(ctx context.Context, req *rpcpb.DeleteInstanceRequest, opts ...gax.CallOption) (*DeleteInstanceOperation, error)
- func (c *ProvisioningClient) DeleteInstanceOperation(name string) *DeleteInstanceOperation
- func (c *ProvisioningClient) GetInstance(ctx context.Context, req *rpcpb.GetInstanceRequest, opts ...gax.CallOption) (*rpcpb.Instance, error)
- type RegistryCallOptions
- type RegistryClient
- func (c *RegistryClient) Close() error
- func (c *RegistryClient) Connection() *grpc.ClientConndeprecated
- func (c *RegistryClient) CreateApi(ctx context.Context, req *rpcpb.CreateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
- func (c *RegistryClient) CreateApiDeployment(ctx context.Context, req *rpcpb.CreateApiDeploymentRequest, ...) (*rpcpb.ApiDeployment, error)
- func (c *RegistryClient) CreateApiSpec(ctx context.Context, req *rpcpb.CreateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) CreateApiVersion(ctx context.Context, req *rpcpb.CreateApiVersionRequest, ...) (*rpcpb.ApiVersion, error)
- func (c *RegistryClient) CreateArtifact(ctx context.Context, req *rpcpb.CreateArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
- func (c *RegistryClient) DeleteApi(ctx context.Context, req *rpcpb.DeleteApiRequest, opts ...gax.CallOption) error
- func (c *RegistryClient) DeleteApiDeployment(ctx context.Context, req *rpcpb.DeleteApiDeploymentRequest, ...) error
- func (c *RegistryClient) DeleteApiDeploymentRevision(ctx context.Context, req *rpcpb.DeleteApiDeploymentRevisionRequest, ...) (*rpcpb.ApiDeployment, error)
- func (c *RegistryClient) DeleteApiSpec(ctx context.Context, req *rpcpb.DeleteApiSpecRequest, opts ...gax.CallOption) error
- func (c *RegistryClient) DeleteApiSpecRevision(ctx context.Context, req *rpcpb.DeleteApiSpecRevisionRequest, ...) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) DeleteApiVersion(ctx context.Context, req *rpcpb.DeleteApiVersionRequest, ...) error
- func (c *RegistryClient) DeleteArtifact(ctx context.Context, req *rpcpb.DeleteArtifactRequest, opts ...gax.CallOption) error
- func (c *RegistryClient) GetApi(ctx context.Context, req *rpcpb.GetApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
- func (c *RegistryClient) GetApiDeployment(ctx context.Context, req *rpcpb.GetApiDeploymentRequest, ...) (*rpcpb.ApiDeployment, error)
- func (c *RegistryClient) GetApiSpec(ctx context.Context, req *rpcpb.GetApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) GetApiSpecContents(ctx context.Context, req *rpcpb.GetApiSpecContentsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *RegistryClient) GetApiVersion(ctx context.Context, req *rpcpb.GetApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
- func (c *RegistryClient) GetArtifact(ctx context.Context, req *rpcpb.GetArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
- func (c *RegistryClient) GetArtifactContents(ctx context.Context, req *rpcpb.GetArtifactContentsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *RegistryClient) GrpcClient() rpcpb.RegistryClient
- func (c *RegistryClient) ListApiDeploymentRevisions(ctx context.Context, req *rpcpb.ListApiDeploymentRevisionsRequest, ...) *ApiDeploymentIterator
- func (c *RegistryClient) ListApiDeployments(ctx context.Context, req *rpcpb.ListApiDeploymentsRequest, ...) *ApiDeploymentIterator
- func (c *RegistryClient) ListApiSpecRevisions(ctx context.Context, req *rpcpb.ListApiSpecRevisionsRequest, ...) *ApiSpecIterator
- func (c *RegistryClient) ListApiSpecs(ctx context.Context, req *rpcpb.ListApiSpecsRequest, opts ...gax.CallOption) *ApiSpecIterator
- func (c *RegistryClient) ListApiVersions(ctx context.Context, req *rpcpb.ListApiVersionsRequest, opts ...gax.CallOption) *ApiVersionIterator
- func (c *RegistryClient) ListApis(ctx context.Context, req *rpcpb.ListApisRequest, opts ...gax.CallOption) *ApiIterator
- func (c *RegistryClient) ListArtifacts(ctx context.Context, req *rpcpb.ListArtifactsRequest, opts ...gax.CallOption) *ArtifactIterator
- func (c *RegistryClient) ReplaceArtifact(ctx context.Context, req *rpcpb.ReplaceArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
- func (c *RegistryClient) RollbackApiDeployment(ctx context.Context, req *rpcpb.RollbackApiDeploymentRequest, ...) (*rpcpb.ApiDeployment, error)
- func (c *RegistryClient) RollbackApiSpec(ctx context.Context, req *rpcpb.RollbackApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) TagApiDeploymentRevision(ctx context.Context, req *rpcpb.TagApiDeploymentRevisionRequest, ...) (*rpcpb.ApiDeployment, error)
- func (c *RegistryClient) TagApiSpecRevision(ctx context.Context, req *rpcpb.TagApiSpecRevisionRequest, ...) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) UpdateApi(ctx context.Context, req *rpcpb.UpdateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
- func (c *RegistryClient) UpdateApiDeployment(ctx context.Context, req *rpcpb.UpdateApiDeploymentRequest, ...) (*rpcpb.ApiDeployment, error)
- func (c *RegistryClient) UpdateApiSpec(ctx context.Context, req *rpcpb.UpdateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) UpdateApiVersion(ctx context.Context, req *rpcpb.UpdateApiVersionRequest, ...) (*rpcpb.ApiVersion, error)
Examples ¶
- AdminClient.CreateProject
- AdminClient.DeleteProject
- AdminClient.GetProject
- AdminClient.GetStatus
- AdminClient.GetStorage
- AdminClient.ListProjects
- AdminClient.MigrateDatabase
- AdminClient.UpdateProject
- NewAdminClient
- NewProvisioningClient
- NewRegistryClient
- ProvisioningClient.CreateInstance
- ProvisioningClient.DeleteInstance
- ProvisioningClient.GetInstance
- RegistryClient.CreateApi
- RegistryClient.CreateApiDeployment
- RegistryClient.CreateApiSpec
- RegistryClient.CreateApiVersion
- RegistryClient.CreateArtifact
- RegistryClient.DeleteApi
- RegistryClient.DeleteApiDeployment
- RegistryClient.DeleteApiDeploymentRevision
- RegistryClient.DeleteApiSpec
- RegistryClient.DeleteApiSpecRevision
- RegistryClient.DeleteApiVersion
- RegistryClient.DeleteArtifact
- RegistryClient.GetApi
- RegistryClient.GetApiDeployment
- RegistryClient.GetApiSpec
- RegistryClient.GetApiSpecContents
- RegistryClient.GetApiVersion
- RegistryClient.GetArtifact
- RegistryClient.GetArtifactContents
- RegistryClient.ListApiDeploymentRevisions
- RegistryClient.ListApiDeployments
- RegistryClient.ListApiSpecRevisions
- RegistryClient.ListApiSpecs
- RegistryClient.ListApiVersions
- RegistryClient.ListApis
- RegistryClient.ListArtifacts
- RegistryClient.ReplaceArtifact
- RegistryClient.RollbackApiDeployment
- RegistryClient.RollbackApiSpec
- RegistryClient.TagApiDeploymentRevision
- RegistryClient.TagApiSpecRevision
- RegistryClient.UpdateApi
- RegistryClient.UpdateApiDeployment
- RegistryClient.UpdateApiSpec
- RegistryClient.UpdateApiVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AdminCallOptions ¶ added in v0.3.5
type AdminCallOptions struct { GetStatus []gax.CallOption GetStorage []gax.CallOption MigrateDatabase []gax.CallOption ListProjects []gax.CallOption GetProject []gax.CallOption CreateProject []gax.CallOption UpdateProject []gax.CallOption DeleteProject []gax.CallOption }
AdminCallOptions contains the retry settings for each method of AdminClient.
type AdminClient ¶ added in v0.3.5
type AdminClient struct { // The call options for this service. CallOptions *AdminCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
AdminClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Admin service supports setup and operation of an API registry. It is typically not included in hosted versions of the API.
func NewAdminClient ¶ added in v0.3.5
func NewAdminClient(ctx context.Context, opts ...option.ClientOption) (*AdminClient, error)
NewAdminClient creates a new admin client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The Admin service supports setup and operation of an API registry. It is typically not included in hosted versions of the API.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*AdminClient) Close ¶ added in v0.3.5
func (c *AdminClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AdminClient) Connection
deprecated
added in
v0.3.5
func (c *AdminClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*AdminClient) CreateProject ¶ added in v0.3.5
func (c *AdminClient) CreateProject(ctx context.Context, req *rpcpb.CreateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
CreateProject createProject creates a specified project. (– api-linter: standard-methods=disabled –) (– api-linter: core::0133::http-uri-parent=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Project has an implicit parent. –) (– api-linter: core::0133::method-signature=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Project has an implicit parent. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateProjectRequest. } resp, err := c.CreateProject(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AdminClient) DeleteProject ¶ added in v0.3.5
func (c *AdminClient) DeleteProject(ctx context.Context, req *rpcpb.DeleteProjectRequest, opts ...gax.CallOption) error
DeleteProject deleteProject removes a specified project and all of the resources that it owns.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteProjectRequest. } err = c.DeleteProject(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*AdminClient) GetProject ¶ added in v0.3.5
func (c *AdminClient) GetProject(ctx context.Context, req *rpcpb.GetProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
GetProject getProject returns a specified project.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetProjectRequest. } resp, err := c.GetProject(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AdminClient) GetStatus ¶ added in v0.3.5
func (c *AdminClient) GetStatus(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*rpcpb.Status, error)
GetStatus getStatus returns the status of the service. (– api-linter: core::0131::request-message-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –) (– api-linter: core::0131::method-signature=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –) (– api-linter: core::0131::http-uri-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" emptypb "google.golang.org/protobuf/types/known/emptypb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &emptypb.Empty{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/protobuf/types/known/emptypb#Empty. } resp, err := c.GetStatus(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AdminClient) GetStorage ¶ added in v0.4.2
func (c *AdminClient) GetStorage(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*rpcpb.Storage, error)
GetStorage getStorage returns information about the storage used by the service. (– api-linter: core::0131::request-message-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –) (– api-linter: core::0131::method-signature=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –) (– api-linter: core::0131::http-uri-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" emptypb "google.golang.org/protobuf/types/known/emptypb" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &emptypb.Empty{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/protobuf/types/known/emptypb#Empty. } resp, err := c.GetStorage(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AdminClient) GrpcClient ¶ added in v0.3.8
func (c *AdminClient) GrpcClient() rpcpb.AdminClient
func (*AdminClient) ListProjects ¶ added in v0.3.5
func (c *AdminClient) ListProjects(ctx context.Context, req *rpcpb.ListProjectsRequest, opts ...gax.CallOption) *ProjectIterator
ListProjects listProjects returns matching projects. (– api-linter: standard-methods=disabled –) (– api-linter: core::0132::method-signature=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): projects are top-level resources. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListProjectsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListProjectsRequest. } it := c.ListProjects(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*AdminClient) MigrateDatabase ¶ added in v0.3.11
func (c *AdminClient) MigrateDatabase(ctx context.Context, req *rpcpb.MigrateDatabaseRequest, opts ...gax.CallOption) (*MigrateDatabaseOperation, error)
MigrateDatabase migrateDatabase attempts to migrate the database to the current schema.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.MigrateDatabaseRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#MigrateDatabaseRequest. } op, err := c.MigrateDatabase(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AdminClient) MigrateDatabaseOperation ¶ added in v0.3.11
func (c *AdminClient) MigrateDatabaseOperation(name string) *MigrateDatabaseOperation
MigrateDatabaseOperation returns a new MigrateDatabaseOperation from a given name. The name must be that of a previously created MigrateDatabaseOperation, possibly from a different process.
func (*AdminClient) UpdateProject ¶ added in v0.3.5
func (c *AdminClient) UpdateProject(ctx context.Context, req *rpcpb.UpdateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
UpdateProject updateProject can be used to modify a specified project.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateProjectRequest. } resp, err := c.UpdateProject(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type ApiDeploymentIterator ¶ added in v0.3.6
type ApiDeploymentIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.ApiDeployment, nextPageToken string, err error) // contains filtered or unexported fields }
ApiDeploymentIterator manages a stream of *rpcpb.ApiDeployment.
func (*ApiDeploymentIterator) Next ¶ added in v0.3.6
func (it *ApiDeploymentIterator) Next() (*rpcpb.ApiDeployment, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ApiDeploymentIterator) PageInfo ¶ added in v0.3.6
func (it *ApiDeploymentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ApiIterator ¶
type ApiIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.Api, nextPageToken string, err error) // contains filtered or unexported fields }
ApiIterator manages a stream of *rpcpb.Api.
func (*ApiIterator) Next ¶
func (it *ApiIterator) Next() (*rpcpb.Api, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ApiIterator) PageInfo ¶
func (it *ApiIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ApiSpecIterator ¶
type ApiSpecIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.ApiSpec, nextPageToken string, err error) // contains filtered or unexported fields }
ApiSpecIterator manages a stream of *rpcpb.ApiSpec.
func (*ApiSpecIterator) Next ¶
func (it *ApiSpecIterator) Next() (*rpcpb.ApiSpec, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ApiSpecIterator) PageInfo ¶
func (it *ApiSpecIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ApiVersionIterator ¶
type ApiVersionIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.ApiVersion, nextPageToken string, err error) // contains filtered or unexported fields }
ApiVersionIterator manages a stream of *rpcpb.ApiVersion.
func (*ApiVersionIterator) Next ¶
func (it *ApiVersionIterator) Next() (*rpcpb.ApiVersion, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ApiVersionIterator) PageInfo ¶
func (it *ApiVersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ArtifactIterator ¶
type ArtifactIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.Artifact, nextPageToken string, err error) // contains filtered or unexported fields }
ArtifactIterator manages a stream of *rpcpb.Artifact.
func (*ArtifactIterator) Next ¶
func (it *ArtifactIterator) Next() (*rpcpb.Artifact, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ArtifactIterator) PageInfo ¶
func (it *ArtifactIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CreateInstanceOperation ¶ added in v0.5.1
type CreateInstanceOperation struct {
// contains filtered or unexported fields
}
CreateInstanceOperation manages a long-running operation from CreateInstance.
func (*CreateInstanceOperation) Done ¶ added in v0.5.1
func (op *CreateInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateInstanceOperation) Metadata ¶ added in v0.5.1
func (op *CreateInstanceOperation) Metadata() (*rpcpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateInstanceOperation) Name ¶ added in v0.5.1
func (op *CreateInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateInstanceOperation) Poll ¶ added in v0.5.1
func (op *CreateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rpcpb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateInstanceOperation) Wait ¶ added in v0.5.1
func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rpcpb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteInstanceOperation ¶ added in v0.5.1
type DeleteInstanceOperation struct {
// contains filtered or unexported fields
}
DeleteInstanceOperation manages a long-running operation from DeleteInstance.
func (*DeleteInstanceOperation) Done ¶ added in v0.5.1
func (op *DeleteInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteInstanceOperation) Metadata ¶ added in v0.5.1
func (op *DeleteInstanceOperation) Metadata() (*rpcpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteInstanceOperation) Name ¶ added in v0.5.1
func (op *DeleteInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteInstanceOperation) Poll ¶ added in v0.5.1
func (op *DeleteInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteInstanceOperation) Wait ¶ added in v0.5.1
func (op *DeleteInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type MigrateDatabaseOperation ¶ added in v0.3.11
type MigrateDatabaseOperation struct {
// contains filtered or unexported fields
}
MigrateDatabaseOperation manages a long-running operation from MigrateDatabase.
func (*MigrateDatabaseOperation) Done ¶ added in v0.3.11
func (op *MigrateDatabaseOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*MigrateDatabaseOperation) Metadata ¶ added in v0.3.11
func (op *MigrateDatabaseOperation) Metadata() (*rpcpb.MigrateDatabaseMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*MigrateDatabaseOperation) Name ¶ added in v0.3.11
func (op *MigrateDatabaseOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*MigrateDatabaseOperation) Poll ¶ added in v0.3.11
func (op *MigrateDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rpcpb.MigrateDatabaseResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*MigrateDatabaseOperation) Wait ¶ added in v0.3.11
func (op *MigrateDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rpcpb.MigrateDatabaseResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ProjectIterator ¶
type ProjectIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.Project, nextPageToken string, err error) // contains filtered or unexported fields }
ProjectIterator manages a stream of *rpcpb.Project.
func (*ProjectIterator) Next ¶
func (it *ProjectIterator) Next() (*rpcpb.Project, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ProjectIterator) PageInfo ¶
func (it *ProjectIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ProvisioningCallOptions ¶ added in v0.5.1
type ProvisioningCallOptions struct { CreateInstance []gax.CallOption DeleteInstance []gax.CallOption GetInstance []gax.CallOption }
ProvisioningCallOptions contains the retry settings for each method of ProvisioningClient.
type ProvisioningClient ¶ added in v0.5.1
type ProvisioningClient struct { // The call options for this service. CallOptions *ProvisioningCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
ProvisioningClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The service that is used for managing the data plane provisioning of the Registry.
func NewProvisioningClient ¶ added in v0.5.1
func NewProvisioningClient(ctx context.Context, opts ...option.ClientOption) (*ProvisioningClient, error)
NewProvisioningClient creates a new provisioning client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The service that is used for managing the data plane provisioning of the Registry.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewProvisioningClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ProvisioningClient) Close ¶ added in v0.5.1
func (c *ProvisioningClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ProvisioningClient) Connection
deprecated
added in
v0.5.1
func (c *ProvisioningClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ProvisioningClient) CreateInstance ¶ added in v0.5.1
func (c *ProvisioningClient) CreateInstance(ctx context.Context, req *rpcpb.CreateInstanceRequest, opts ...gax.CallOption) (*CreateInstanceOperation, error)
CreateInstance provisions instance resources for the Registry.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewProvisioningClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateInstanceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateInstanceRequest. } op, err := c.CreateInstance(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ProvisioningClient) CreateInstanceOperation ¶ added in v0.5.1
func (c *ProvisioningClient) CreateInstanceOperation(name string) *CreateInstanceOperation
CreateInstanceOperation returns a new CreateInstanceOperation from a given name. The name must be that of a previously created CreateInstanceOperation, possibly from a different process.
func (*ProvisioningClient) DeleteInstance ¶ added in v0.5.1
func (c *ProvisioningClient) DeleteInstance(ctx context.Context, req *rpcpb.DeleteInstanceRequest, opts ...gax.CallOption) (*DeleteInstanceOperation, error)
DeleteInstance deletes the Registry instance.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewProvisioningClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteInstanceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteInstanceRequest. } op, err := c.DeleteInstance(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*ProvisioningClient) DeleteInstanceOperation ¶ added in v0.5.1
func (c *ProvisioningClient) DeleteInstanceOperation(name string) *DeleteInstanceOperation
DeleteInstanceOperation returns a new DeleteInstanceOperation from a given name. The name must be that of a previously created DeleteInstanceOperation, possibly from a different process.
func (*ProvisioningClient) GetInstance ¶ added in v0.5.1
func (c *ProvisioningClient) GetInstance(ctx context.Context, req *rpcpb.GetInstanceRequest, opts ...gax.CallOption) (*rpcpb.Instance, error)
GetInstance gets details of a single Instance.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewProvisioningClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetInstanceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetInstanceRequest. } resp, err := c.GetInstance(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type RegistryCallOptions ¶
type RegistryCallOptions struct { ListApis []gax.CallOption GetApi []gax.CallOption CreateApi []gax.CallOption UpdateApi []gax.CallOption DeleteApi []gax.CallOption ListApiVersions []gax.CallOption GetApiVersion []gax.CallOption CreateApiVersion []gax.CallOption UpdateApiVersion []gax.CallOption DeleteApiVersion []gax.CallOption ListApiSpecs []gax.CallOption GetApiSpec []gax.CallOption GetApiSpecContents []gax.CallOption CreateApiSpec []gax.CallOption UpdateApiSpec []gax.CallOption DeleteApiSpec []gax.CallOption TagApiSpecRevision []gax.CallOption ListApiSpecRevisions []gax.CallOption RollbackApiSpec []gax.CallOption DeleteApiSpecRevision []gax.CallOption ListApiDeployments []gax.CallOption GetApiDeployment []gax.CallOption CreateApiDeployment []gax.CallOption UpdateApiDeployment []gax.CallOption DeleteApiDeployment []gax.CallOption TagApiDeploymentRevision []gax.CallOption ListApiDeploymentRevisions []gax.CallOption RollbackApiDeployment []gax.CallOption DeleteApiDeploymentRevision []gax.CallOption ListArtifacts []gax.CallOption GetArtifact []gax.CallOption GetArtifactContents []gax.CallOption CreateArtifact []gax.CallOption ReplaceArtifact []gax.CallOption DeleteArtifact []gax.CallOption }
RegistryCallOptions contains the retry settings for each method of RegistryClient.
type RegistryClient ¶
type RegistryClient struct { // The call options for this service. CallOptions *RegistryCallOptions // contains filtered or unexported fields }
RegistryClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Registry service allows teams to manage descriptions of APIs.
func NewRegistryClient ¶
func NewRegistryClient(ctx context.Context, opts ...option.ClientOption) (*RegistryClient, error)
NewRegistryClient creates a new registry client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The Registry service allows teams to manage descriptions of APIs.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*RegistryClient) Close ¶
func (c *RegistryClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegistryClient) Connection
deprecated
func (c *RegistryClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RegistryClient) CreateApi ¶
func (c *RegistryClient) CreateApi(ctx context.Context, req *rpcpb.CreateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
CreateApi createApi creates a specified API.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateApiRequest. } resp, err := c.CreateApi(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateApiDeployment ¶ added in v0.3.6
func (c *RegistryClient) CreateApiDeployment(ctx context.Context, req *rpcpb.CreateApiDeploymentRequest, opts ...gax.CallOption) (*rpcpb.ApiDeployment, error)
CreateApiDeployment createApiDeployment creates a specified deployment.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateApiDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateApiDeploymentRequest. } resp, err := c.CreateApiDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateApiSpec ¶
func (c *RegistryClient) CreateApiSpec(ctx context.Context, req *rpcpb.CreateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
CreateApiSpec createApiSpec creates a specified spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateApiSpecRequest. } resp, err := c.CreateApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateApiVersion ¶
func (c *RegistryClient) CreateApiVersion(ctx context.Context, req *rpcpb.CreateApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
CreateApiVersion createApiVersion creates a specified version.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateApiVersionRequest. } resp, err := c.CreateApiVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateArtifact ¶
func (c *RegistryClient) CreateArtifact(ctx context.Context, req *rpcpb.CreateArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
CreateArtifact createArtifact creates a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateArtifactRequest. } resp, err := c.CreateArtifact(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) DeleteApi ¶
func (c *RegistryClient) DeleteApi(ctx context.Context, req *rpcpb.DeleteApiRequest, opts ...gax.CallOption) error
DeleteApi deleteApi removes a specified API and all of the resources that it owns.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiRequest. } err = c.DeleteApi(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteApiDeployment ¶ added in v0.3.6
func (c *RegistryClient) DeleteApiDeployment(ctx context.Context, req *rpcpb.DeleteApiDeploymentRequest, opts ...gax.CallOption) error
DeleteApiDeployment deleteApiDeployment removes a specified deployment, all revisions, and all child resources (e.g. artifacts).
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiDeploymentRequest. } err = c.DeleteApiDeployment(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteApiDeploymentRevision ¶ added in v0.3.6
func (c *RegistryClient) DeleteApiDeploymentRevision(ctx context.Context, req *rpcpb.DeleteApiDeploymentRevisionRequest, opts ...gax.CallOption) (*rpcpb.ApiDeployment, error)
DeleteApiDeploymentRevision deleteApiDeploymentRevision deletes a revision of a deployment.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiDeploymentRevisionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiDeploymentRevisionRequest. } resp, err := c.DeleteApiDeploymentRevision(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) DeleteApiSpec ¶
func (c *RegistryClient) DeleteApiSpec(ctx context.Context, req *rpcpb.DeleteApiSpecRequest, opts ...gax.CallOption) error
DeleteApiSpec deleteApiSpec removes a specified spec, all revisions, and all child resources (e.g. artifacts).
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiSpecRequest. } err = c.DeleteApiSpec(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteApiSpecRevision ¶
func (c *RegistryClient) DeleteApiSpecRevision(ctx context.Context, req *rpcpb.DeleteApiSpecRevisionRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
DeleteApiSpecRevision deleteApiSpecRevision deletes a revision of a spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiSpecRevisionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiSpecRevisionRequest. } resp, err := c.DeleteApiSpecRevision(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) DeleteApiVersion ¶
func (c *RegistryClient) DeleteApiVersion(ctx context.Context, req *rpcpb.DeleteApiVersionRequest, opts ...gax.CallOption) error
DeleteApiVersion deleteApiVersion removes a specified version and all of the resources that it owns.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiVersionRequest. } err = c.DeleteApiVersion(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteArtifact ¶
func (c *RegistryClient) DeleteArtifact(ctx context.Context, req *rpcpb.DeleteArtifactRequest, opts ...gax.CallOption) error
DeleteArtifact deleteArtifact removes a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteArtifactRequest. } err = c.DeleteArtifact(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) GetApi ¶
func (c *RegistryClient) GetApi(ctx context.Context, req *rpcpb.GetApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
GetApi getApi returns a specified API.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiRequest. } resp, err := c.GetApi(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetApiDeployment ¶ added in v0.3.6
func (c *RegistryClient) GetApiDeployment(ctx context.Context, req *rpcpb.GetApiDeploymentRequest, opts ...gax.CallOption) (*rpcpb.ApiDeployment, error)
GetApiDeployment getApiDeployment returns a specified deployment.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiDeploymentRequest. } resp, err := c.GetApiDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetApiSpec ¶
func (c *RegistryClient) GetApiSpec(ctx context.Context, req *rpcpb.GetApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
GetApiSpec getApiSpec returns a specified spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiSpecRequest. } resp, err := c.GetApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetApiSpecContents ¶
func (c *RegistryClient) GetApiSpecContents(ctx context.Context, req *rpcpb.GetApiSpecContentsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)
GetApiSpecContents getApiSpecContents returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiSpecContentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiSpecContentsRequest. } resp, err := c.GetApiSpecContents(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetApiVersion ¶
func (c *RegistryClient) GetApiVersion(ctx context.Context, req *rpcpb.GetApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
GetApiVersion getApiVersion returns a specified version.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiVersionRequest. } resp, err := c.GetApiVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetArtifact ¶
func (c *RegistryClient) GetArtifact(ctx context.Context, req *rpcpb.GetArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
GetArtifact getArtifact returns a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetArtifactRequest. } resp, err := c.GetArtifact(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetArtifactContents ¶
func (c *RegistryClient) GetArtifactContents(ctx context.Context, req *rpcpb.GetArtifactContentsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)
GetArtifactContents getArtifactContents returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetArtifactContentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetArtifactContentsRequest. } resp, err := c.GetArtifactContents(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GrpcClient ¶
func (c *RegistryClient) GrpcClient() rpcpb.RegistryClient
func (*RegistryClient) ListApiDeploymentRevisions ¶ added in v0.3.6
func (c *RegistryClient) ListApiDeploymentRevisions(ctx context.Context, req *rpcpb.ListApiDeploymentRevisionsRequest, opts ...gax.CallOption) *ApiDeploymentIterator
ListApiDeploymentRevisions listApiDeploymentRevisions lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiDeploymentRevisionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiDeploymentRevisionsRequest. } it := c.ListApiDeploymentRevisions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApiDeployments ¶ added in v0.3.6
func (c *RegistryClient) ListApiDeployments(ctx context.Context, req *rpcpb.ListApiDeploymentsRequest, opts ...gax.CallOption) *ApiDeploymentIterator
ListApiDeployments listApiDeployments returns matching deployments.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiDeploymentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiDeploymentsRequest. } it := c.ListApiDeployments(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApiSpecRevisions ¶
func (c *RegistryClient) ListApiSpecRevisions(ctx context.Context, req *rpcpb.ListApiSpecRevisionsRequest, opts ...gax.CallOption) *ApiSpecIterator
ListApiSpecRevisions listApiSpecRevisions lists all revisions of a spec. Revisions are returned in descending order of revision creation time.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiSpecRevisionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiSpecRevisionsRequest. } it := c.ListApiSpecRevisions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApiSpecs ¶
func (c *RegistryClient) ListApiSpecs(ctx context.Context, req *rpcpb.ListApiSpecsRequest, opts ...gax.CallOption) *ApiSpecIterator
ListApiSpecs listApiSpecs returns matching specs.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiSpecsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiSpecsRequest. } it := c.ListApiSpecs(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApiVersions ¶
func (c *RegistryClient) ListApiVersions(ctx context.Context, req *rpcpb.ListApiVersionsRequest, opts ...gax.CallOption) *ApiVersionIterator
ListApiVersions listApiVersions returns matching versions.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiVersionsRequest. } it := c.ListApiVersions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApis ¶
func (c *RegistryClient) ListApis(ctx context.Context, req *rpcpb.ListApisRequest, opts ...gax.CallOption) *ApiIterator
ListApis listApis returns matching APIs.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApisRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApisRequest. } it := c.ListApis(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListArtifacts ¶
func (c *RegistryClient) ListArtifacts(ctx context.Context, req *rpcpb.ListArtifactsRequest, opts ...gax.CallOption) *ArtifactIterator
ListArtifacts listArtifacts returns matching artifacts.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListArtifactsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListArtifactsRequest. } it := c.ListArtifacts(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ReplaceArtifact ¶
func (c *RegistryClient) ReplaceArtifact(ctx context.Context, req *rpcpb.ReplaceArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
ReplaceArtifact replaceArtifact can be used to replace a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ReplaceArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ReplaceArtifactRequest. } resp, err := c.ReplaceArtifact(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) RollbackApiDeployment ¶ added in v0.3.6
func (c *RegistryClient) RollbackApiDeployment(ctx context.Context, req *rpcpb.RollbackApiDeploymentRequest, opts ...gax.CallOption) (*rpcpb.ApiDeployment, error)
RollbackApiDeployment rollbackApiDeployment sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.RollbackApiDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#RollbackApiDeploymentRequest. } resp, err := c.RollbackApiDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) RollbackApiSpec ¶
func (c *RegistryClient) RollbackApiSpec(ctx context.Context, req *rpcpb.RollbackApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
RollbackApiSpec rollbackApiSpec sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.RollbackApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#RollbackApiSpecRequest. } resp, err := c.RollbackApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) TagApiDeploymentRevision ¶ added in v0.3.6
func (c *RegistryClient) TagApiDeploymentRevision(ctx context.Context, req *rpcpb.TagApiDeploymentRevisionRequest, opts ...gax.CallOption) (*rpcpb.ApiDeployment, error)
TagApiDeploymentRevision tagApiDeploymentRevision adds a tag to a specified revision of a deployment.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.TagApiDeploymentRevisionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#TagApiDeploymentRevisionRequest. } resp, err := c.TagApiDeploymentRevision(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) TagApiSpecRevision ¶
func (c *RegistryClient) TagApiSpecRevision(ctx context.Context, req *rpcpb.TagApiSpecRevisionRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
TagApiSpecRevision tagApiSpecRevision adds a tag to a specified revision of a spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.TagApiSpecRevisionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#TagApiSpecRevisionRequest. } resp, err := c.TagApiSpecRevision(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateApi ¶
func (c *RegistryClient) UpdateApi(ctx context.Context, req *rpcpb.UpdateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
UpdateApi updateApi can be used to modify a specified API.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateApiRequest. } resp, err := c.UpdateApi(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateApiDeployment ¶ added in v0.3.6
func (c *RegistryClient) UpdateApiDeployment(ctx context.Context, req *rpcpb.UpdateApiDeploymentRequest, opts ...gax.CallOption) (*rpcpb.ApiDeployment, error)
UpdateApiDeployment updateApiDeployment can be used to modify a specified deployment.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateApiDeploymentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateApiDeploymentRequest. } resp, err := c.UpdateApiDeployment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateApiSpec ¶
func (c *RegistryClient) UpdateApiSpec(ctx context.Context, req *rpcpb.UpdateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
UpdateApiSpec updateApiSpec can be used to modify a specified spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateApiSpecRequest. } resp, err := c.UpdateApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateApiVersion ¶
func (c *RegistryClient) UpdateApiVersion(ctx context.Context, req *rpcpb.UpdateApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
UpdateApiVersion updateApiVersion can be used to modify a specified version.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() // 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateApiVersionRequest. } resp, err := c.UpdateApiVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output: