Documentation ¶
Overview ¶
Package appengine is an auto-generated package for the App Engine Admin API.
Provisions and manages developers’ App Engine applications.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
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 := appengine.NewApplicationsClient(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 := appengine.NewApplicationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.CreateApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#CreateApplicationRequest. } op, err := c.CreateApplication(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewApplicationsClient 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 ApplicationsCallOptions
- type ApplicationsClient
- func (c *ApplicationsClient) Close() error
- func (c *ApplicationsClient) Connection() *grpc.ClientConndeprecated
- func (c *ApplicationsClient) CreateApplication(ctx context.Context, req *appenginepb.CreateApplicationRequest, ...) (*CreateApplicationOperation, error)
- func (c *ApplicationsClient) CreateApplicationOperation(name string) *CreateApplicationOperation
- func (c *ApplicationsClient) GetApplication(ctx context.Context, req *appenginepb.GetApplicationRequest, ...) (*appenginepb.Application, error)
- func (c *ApplicationsClient) RepairApplication(ctx context.Context, req *appenginepb.RepairApplicationRequest, ...) (*RepairApplicationOperation, error)
- func (c *ApplicationsClient) RepairApplicationOperation(name string) *RepairApplicationOperation
- func (c *ApplicationsClient) UpdateApplication(ctx context.Context, req *appenginepb.UpdateApplicationRequest, ...) (*UpdateApplicationOperation, error)
- func (c *ApplicationsClient) UpdateApplicationOperation(name string) *UpdateApplicationOperation
- type AuthorizedCertificateIterator
- type AuthorizedCertificatesCallOptions
- type AuthorizedCertificatesClient
- func (c *AuthorizedCertificatesClient) Close() error
- func (c *AuthorizedCertificatesClient) Connection() *grpc.ClientConndeprecated
- func (c *AuthorizedCertificatesClient) CreateAuthorizedCertificate(ctx context.Context, req *appenginepb.CreateAuthorizedCertificateRequest, ...) (*appenginepb.AuthorizedCertificate, error)
- func (c *AuthorizedCertificatesClient) DeleteAuthorizedCertificate(ctx context.Context, req *appenginepb.DeleteAuthorizedCertificateRequest, ...) error
- func (c *AuthorizedCertificatesClient) GetAuthorizedCertificate(ctx context.Context, req *appenginepb.GetAuthorizedCertificateRequest, ...) (*appenginepb.AuthorizedCertificate, error)
- func (c *AuthorizedCertificatesClient) ListAuthorizedCertificates(ctx context.Context, req *appenginepb.ListAuthorizedCertificatesRequest, ...) *AuthorizedCertificateIterator
- func (c *AuthorizedCertificatesClient) UpdateAuthorizedCertificate(ctx context.Context, req *appenginepb.UpdateAuthorizedCertificateRequest, ...) (*appenginepb.AuthorizedCertificate, error)
- type AuthorizedDomainIterator
- type AuthorizedDomainsCallOptions
- type AuthorizedDomainsClient
- type CreateApplicationOperation
- func (op *CreateApplicationOperation) Done() bool
- func (op *CreateApplicationOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *CreateApplicationOperation) Name() string
- func (op *CreateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, error)
- func (op *CreateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, error)
- type CreateDomainMappingOperation
- func (op *CreateDomainMappingOperation) Done() bool
- func (op *CreateDomainMappingOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *CreateDomainMappingOperation) Name() string
- func (op *CreateDomainMappingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, error)
- func (op *CreateDomainMappingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, error)
- type CreateVersionOperation
- func (op *CreateVersionOperation) Done() bool
- func (op *CreateVersionOperation) Metadata() (*appenginepb.CreateVersionMetadataV1, error)
- func (op *CreateVersionOperation) Name() string
- func (op *CreateVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, error)
- func (op *CreateVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, error)
- type DebugInstanceOperation
- func (op *DebugInstanceOperation) Done() bool
- func (op *DebugInstanceOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *DebugInstanceOperation) Name() string
- func (op *DebugInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Instance, error)
- func (op *DebugInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Instance, error)
- type DeleteDomainMappingOperation
- func (op *DeleteDomainMappingOperation) Done() bool
- func (op *DeleteDomainMappingOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *DeleteDomainMappingOperation) Name() string
- func (op *DeleteDomainMappingOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteDomainMappingOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteInstanceOperation
- func (op *DeleteInstanceOperation) Done() bool
- func (op *DeleteInstanceOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 DeleteServiceOperation
- func (op *DeleteServiceOperation) Done() bool
- func (op *DeleteServiceOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *DeleteServiceOperation) Name() string
- func (op *DeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteVersionOperation
- func (op *DeleteVersionOperation) Done() bool
- func (op *DeleteVersionOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *DeleteVersionOperation) Name() string
- func (op *DeleteVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DomainMappingIterator
- type DomainMappingsCallOptions
- type DomainMappingsClient
- func (c *DomainMappingsClient) Close() error
- func (c *DomainMappingsClient) Connection() *grpc.ClientConndeprecated
- func (c *DomainMappingsClient) CreateDomainMapping(ctx context.Context, req *appenginepb.CreateDomainMappingRequest, ...) (*CreateDomainMappingOperation, error)
- func (c *DomainMappingsClient) CreateDomainMappingOperation(name string) *CreateDomainMappingOperation
- func (c *DomainMappingsClient) DeleteDomainMapping(ctx context.Context, req *appenginepb.DeleteDomainMappingRequest, ...) (*DeleteDomainMappingOperation, error)
- func (c *DomainMappingsClient) DeleteDomainMappingOperation(name string) *DeleteDomainMappingOperation
- func (c *DomainMappingsClient) GetDomainMapping(ctx context.Context, req *appenginepb.GetDomainMappingRequest, ...) (*appenginepb.DomainMapping, error)
- func (c *DomainMappingsClient) ListDomainMappings(ctx context.Context, req *appenginepb.ListDomainMappingsRequest, ...) *DomainMappingIterator
- func (c *DomainMappingsClient) UpdateDomainMapping(ctx context.Context, req *appenginepb.UpdateDomainMappingRequest, ...) (*UpdateDomainMappingOperation, error)
- func (c *DomainMappingsClient) UpdateDomainMappingOperation(name string) *UpdateDomainMappingOperation
- type FirewallCallOptions
- type FirewallClient
- func (c *FirewallClient) BatchUpdateIngressRules(ctx context.Context, req *appenginepb.BatchUpdateIngressRulesRequest, ...) (*appenginepb.BatchUpdateIngressRulesResponse, error)
- func (c *FirewallClient) Close() error
- func (c *FirewallClient) Connection() *grpc.ClientConndeprecated
- func (c *FirewallClient) CreateIngressRule(ctx context.Context, req *appenginepb.CreateIngressRuleRequest, ...) (*appenginepb.FirewallRule, error)
- func (c *FirewallClient) DeleteIngressRule(ctx context.Context, req *appenginepb.DeleteIngressRuleRequest, ...) error
- func (c *FirewallClient) GetIngressRule(ctx context.Context, req *appenginepb.GetIngressRuleRequest, ...) (*appenginepb.FirewallRule, error)
- func (c *FirewallClient) ListIngressRules(ctx context.Context, req *appenginepb.ListIngressRulesRequest, ...) *FirewallRuleIterator
- func (c *FirewallClient) UpdateIngressRule(ctx context.Context, req *appenginepb.UpdateIngressRuleRequest, ...) (*appenginepb.FirewallRule, error)
- type FirewallRuleIterator
- type InstanceIterator
- type InstancesCallOptions
- type InstancesClient
- func (c *InstancesClient) Close() error
- func (c *InstancesClient) Connection() *grpc.ClientConndeprecated
- func (c *InstancesClient) DebugInstance(ctx context.Context, req *appenginepb.DebugInstanceRequest, ...) (*DebugInstanceOperation, error)
- func (c *InstancesClient) DebugInstanceOperation(name string) *DebugInstanceOperation
- func (c *InstancesClient) DeleteInstance(ctx context.Context, req *appenginepb.DeleteInstanceRequest, ...) (*DeleteInstanceOperation, error)
- func (c *InstancesClient) DeleteInstanceOperation(name string) *DeleteInstanceOperation
- func (c *InstancesClient) GetInstance(ctx context.Context, req *appenginepb.GetInstanceRequest, ...) (*appenginepb.Instance, error)
- func (c *InstancesClient) ListInstances(ctx context.Context, req *appenginepb.ListInstancesRequest, ...) *InstanceIterator
- type RepairApplicationOperation
- func (op *RepairApplicationOperation) Done() bool
- func (op *RepairApplicationOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *RepairApplicationOperation) Name() string
- func (op *RepairApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, error)
- func (op *RepairApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, error)
- type ServiceIterator
- type ServicesCallOptions
- type ServicesClient
- func (c *ServicesClient) Close() error
- func (c *ServicesClient) Connection() *grpc.ClientConndeprecated
- func (c *ServicesClient) DeleteService(ctx context.Context, req *appenginepb.DeleteServiceRequest, ...) (*DeleteServiceOperation, error)
- func (c *ServicesClient) DeleteServiceOperation(name string) *DeleteServiceOperation
- func (c *ServicesClient) GetService(ctx context.Context, req *appenginepb.GetServiceRequest, ...) (*appenginepb.Service, error)
- func (c *ServicesClient) ListServices(ctx context.Context, req *appenginepb.ListServicesRequest, ...) *ServiceIterator
- func (c *ServicesClient) UpdateService(ctx context.Context, req *appenginepb.UpdateServiceRequest, ...) (*UpdateServiceOperation, error)
- func (c *ServicesClient) UpdateServiceOperation(name string) *UpdateServiceOperation
- type UpdateApplicationOperation
- func (op *UpdateApplicationOperation) Done() bool
- func (op *UpdateApplicationOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *UpdateApplicationOperation) Name() string
- func (op *UpdateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, error)
- func (op *UpdateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, error)
- type UpdateDomainMappingOperation
- func (op *UpdateDomainMappingOperation) Done() bool
- func (op *UpdateDomainMappingOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *UpdateDomainMappingOperation) Name() string
- func (op *UpdateDomainMappingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, error)
- func (op *UpdateDomainMappingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, error)
- type UpdateServiceOperation
- func (op *UpdateServiceOperation) Done() bool
- func (op *UpdateServiceOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *UpdateServiceOperation) Name() string
- func (op *UpdateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Service, error)
- func (op *UpdateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Service, error)
- type UpdateVersionOperation
- func (op *UpdateVersionOperation) Done() bool
- func (op *UpdateVersionOperation) Metadata() (*appenginepb.OperationMetadataV1, error)
- func (op *UpdateVersionOperation) Name() string
- func (op *UpdateVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, error)
- func (op *UpdateVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, error)
- type VersionIterator
- type VersionsCallOptions
- type VersionsClient
- func (c *VersionsClient) Close() error
- func (c *VersionsClient) Connection() *grpc.ClientConndeprecated
- func (c *VersionsClient) CreateVersion(ctx context.Context, req *appenginepb.CreateVersionRequest, ...) (*CreateVersionOperation, error)
- func (c *VersionsClient) CreateVersionOperation(name string) *CreateVersionOperation
- func (c *VersionsClient) DeleteVersion(ctx context.Context, req *appenginepb.DeleteVersionRequest, ...) (*DeleteVersionOperation, error)
- func (c *VersionsClient) DeleteVersionOperation(name string) *DeleteVersionOperation
- func (c *VersionsClient) GetVersion(ctx context.Context, req *appenginepb.GetVersionRequest, ...) (*appenginepb.Version, error)
- func (c *VersionsClient) ListVersions(ctx context.Context, req *appenginepb.ListVersionsRequest, ...) *VersionIterator
- func (c *VersionsClient) UpdateVersion(ctx context.Context, req *appenginepb.UpdateVersionRequest, ...) (*UpdateVersionOperation, error)
- func (c *VersionsClient) UpdateVersionOperation(name string) *UpdateVersionOperation
Examples ¶
- ApplicationsClient.CreateApplication
- ApplicationsClient.GetApplication
- ApplicationsClient.RepairApplication
- ApplicationsClient.UpdateApplication
- AuthorizedCertificatesClient.CreateAuthorizedCertificate
- AuthorizedCertificatesClient.DeleteAuthorizedCertificate
- AuthorizedCertificatesClient.GetAuthorizedCertificate
- AuthorizedCertificatesClient.ListAuthorizedCertificates
- AuthorizedCertificatesClient.UpdateAuthorizedCertificate
- AuthorizedDomainsClient.ListAuthorizedDomains
- DomainMappingsClient.CreateDomainMapping
- DomainMappingsClient.DeleteDomainMapping
- DomainMappingsClient.GetDomainMapping
- DomainMappingsClient.ListDomainMappings
- DomainMappingsClient.UpdateDomainMapping
- FirewallClient.BatchUpdateIngressRules
- FirewallClient.CreateIngressRule
- FirewallClient.DeleteIngressRule
- FirewallClient.GetIngressRule
- FirewallClient.ListIngressRules
- FirewallClient.UpdateIngressRule
- InstancesClient.DebugInstance
- InstancesClient.DeleteInstance
- InstancesClient.GetInstance
- InstancesClient.ListInstances
- NewApplicationsClient
- NewApplicationsRESTClient
- NewAuthorizedCertificatesClient
- NewAuthorizedCertificatesRESTClient
- NewAuthorizedDomainsClient
- NewAuthorizedDomainsRESTClient
- NewDomainMappingsClient
- NewDomainMappingsRESTClient
- NewFirewallClient
- NewFirewallRESTClient
- NewInstancesClient
- NewInstancesRESTClient
- NewServicesClient
- NewServicesRESTClient
- NewVersionsClient
- NewVersionsRESTClient
- ServicesClient.DeleteService
- ServicesClient.GetService
- ServicesClient.ListServices
- ServicesClient.UpdateService
- VersionsClient.CreateVersion
- VersionsClient.DeleteVersion
- VersionsClient.GetVersion
- VersionsClient.ListVersions
- VersionsClient.UpdateVersion
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 ApplicationsCallOptions ¶
type ApplicationsCallOptions struct { GetApplication []gax.CallOption CreateApplication []gax.CallOption UpdateApplication []gax.CallOption RepairApplication []gax.CallOption }
ApplicationsCallOptions contains the retry settings for each method of ApplicationsClient.
type ApplicationsClient ¶
type ApplicationsClient struct { // The call options for this service. CallOptions *ApplicationsCallOptions // 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 }
ApplicationsClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages App Engine applications.
func NewApplicationsClient ¶
func NewApplicationsClient(ctx context.Context, opts ...option.ClientOption) (*ApplicationsClient, error)
NewApplicationsClient creates a new applications client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages App Engine applications.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewApplicationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewApplicationsRESTClient ¶ added in v1.6.0
func NewApplicationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ApplicationsClient, error)
NewApplicationsRESTClient creates a new applications rest client.
Manages App Engine applications.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewApplicationsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ApplicationsClient) Close ¶
func (c *ApplicationsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ApplicationsClient) Connection
deprecated
func (c *ApplicationsClient) 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 (*ApplicationsClient) CreateApplication ¶
func (c *ApplicationsClient) CreateApplication(ctx context.Context, req *appenginepb.CreateApplicationRequest, opts ...gax.CallOption) (*CreateApplicationOperation, error)
CreateApplication creates an App Engine application for a Google Cloud Platform project. Required fields:
id - The ID of the target Cloud Platform project. location - The region (at https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.
For more information about App Engine applications, see Managing Projects, Applications, and Billing (at https://cloud.google.com/appengine/docs/standard/python/console/).
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewApplicationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.CreateApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#CreateApplicationRequest. } op, err := c.CreateApplication(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 (*ApplicationsClient) CreateApplicationOperation ¶
func (c *ApplicationsClient) CreateApplicationOperation(name string) *CreateApplicationOperation
CreateApplicationOperation returns a new CreateApplicationOperation from a given name. The name must be that of a previously created CreateApplicationOperation, possibly from a different process.
func (*ApplicationsClient) GetApplication ¶
func (c *ApplicationsClient) GetApplication(ctx context.Context, req *appenginepb.GetApplicationRequest, opts ...gax.CallOption) (*appenginepb.Application, error)
GetApplication gets information about an application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewApplicationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.GetApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#GetApplicationRequest. } resp, err := c.GetApplication(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ApplicationsClient) RepairApplication ¶
func (c *ApplicationsClient) RepairApplication(ctx context.Context, req *appenginepb.RepairApplicationRequest, opts ...gax.CallOption) (*RepairApplicationOperation, error)
RepairApplication recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. If you have deleted your App Engine service account, this will not be able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params={ (at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B)“name”%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewApplicationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.RepairApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#RepairApplicationRequest. } op, err := c.RepairApplication(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 (*ApplicationsClient) RepairApplicationOperation ¶
func (c *ApplicationsClient) RepairApplicationOperation(name string) *RepairApplicationOperation
RepairApplicationOperation returns a new RepairApplicationOperation from a given name. The name must be that of a previously created RepairApplicationOperation, possibly from a different process.
func (*ApplicationsClient) UpdateApplication ¶
func (c *ApplicationsClient) UpdateApplication(ctx context.Context, req *appenginepb.UpdateApplicationRequest, opts ...gax.CallOption) (*UpdateApplicationOperation, error)
UpdateApplication updates the specified Application resource. You can update the following fields:
auth_domain - Google authentication domain for controlling user access to the application. default_cookie_expiration - Cookie expiration policy for the application. iap - Identity-Aware Proxy properties for the application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewApplicationsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.UpdateApplicationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#UpdateApplicationRequest. } op, err := c.UpdateApplication(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 (*ApplicationsClient) UpdateApplicationOperation ¶
func (c *ApplicationsClient) UpdateApplicationOperation(name string) *UpdateApplicationOperation
UpdateApplicationOperation returns a new UpdateApplicationOperation from a given name. The name must be that of a previously created UpdateApplicationOperation, possibly from a different process.
type AuthorizedCertificateIterator ¶
type AuthorizedCertificateIterator 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 []*appenginepb.AuthorizedCertificate, nextPageToken string, err error) // contains filtered or unexported fields }
AuthorizedCertificateIterator manages a stream of *appenginepb.AuthorizedCertificate.
func (*AuthorizedCertificateIterator) Next ¶
func (it *AuthorizedCertificateIterator) Next() (*appenginepb.AuthorizedCertificate, 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 (*AuthorizedCertificateIterator) PageInfo ¶
func (it *AuthorizedCertificateIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AuthorizedCertificatesCallOptions ¶
type AuthorizedCertificatesCallOptions struct { ListAuthorizedCertificates []gax.CallOption GetAuthorizedCertificate []gax.CallOption CreateAuthorizedCertificate []gax.CallOption UpdateAuthorizedCertificate []gax.CallOption DeleteAuthorizedCertificate []gax.CallOption }
AuthorizedCertificatesCallOptions contains the retry settings for each method of AuthorizedCertificatesClient.
type AuthorizedCertificatesClient ¶
type AuthorizedCertificatesClient struct { // The call options for this service. CallOptions *AuthorizedCertificatesCallOptions // contains filtered or unexported fields }
AuthorizedCertificatesClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages SSL certificates a user is authorized to administer. A user can administer any SSL certificates applicable to their authorized domains.
func NewAuthorizedCertificatesClient ¶
func NewAuthorizedCertificatesClient(ctx context.Context, opts ...option.ClientOption) (*AuthorizedCertificatesClient, error)
NewAuthorizedCertificatesClient creates a new authorized certificates client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages SSL certificates a user is authorized to administer. A user can administer any SSL certificates applicable to their authorized domains.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewAuthorizedCertificatesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewAuthorizedCertificatesRESTClient ¶ added in v1.6.0
func NewAuthorizedCertificatesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AuthorizedCertificatesClient, error)
NewAuthorizedCertificatesRESTClient creates a new authorized certificates rest client.
Manages SSL certificates a user is authorized to administer. A user can administer any SSL certificates applicable to their authorized domains.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewAuthorizedCertificatesRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*AuthorizedCertificatesClient) Close ¶
func (c *AuthorizedCertificatesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AuthorizedCertificatesClient) Connection
deprecated
func (c *AuthorizedCertificatesClient) 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 (*AuthorizedCertificatesClient) CreateAuthorizedCertificate ¶
func (c *AuthorizedCertificatesClient) CreateAuthorizedCertificate(ctx context.Context, req *appenginepb.CreateAuthorizedCertificateRequest, opts ...gax.CallOption) (*appenginepb.AuthorizedCertificate, error)
CreateAuthorizedCertificate uploads the specified SSL certificate.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewAuthorizedCertificatesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.CreateAuthorizedCertificateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#CreateAuthorizedCertificateRequest. } resp, err := c.CreateAuthorizedCertificate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AuthorizedCertificatesClient) DeleteAuthorizedCertificate ¶
func (c *AuthorizedCertificatesClient) DeleteAuthorizedCertificate(ctx context.Context, req *appenginepb.DeleteAuthorizedCertificateRequest, opts ...gax.CallOption) error
DeleteAuthorizedCertificate deletes the specified SSL certificate.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewAuthorizedCertificatesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.DeleteAuthorizedCertificateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#DeleteAuthorizedCertificateRequest. } err = c.DeleteAuthorizedCertificate(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*AuthorizedCertificatesClient) GetAuthorizedCertificate ¶
func (c *AuthorizedCertificatesClient) GetAuthorizedCertificate(ctx context.Context, req *appenginepb.GetAuthorizedCertificateRequest, opts ...gax.CallOption) (*appenginepb.AuthorizedCertificate, error)
GetAuthorizedCertificate gets the specified SSL certificate.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewAuthorizedCertificatesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.GetAuthorizedCertificateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#GetAuthorizedCertificateRequest. } resp, err := c.GetAuthorizedCertificate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AuthorizedCertificatesClient) ListAuthorizedCertificates ¶
func (c *AuthorizedCertificatesClient) ListAuthorizedCertificates(ctx context.Context, req *appenginepb.ListAuthorizedCertificatesRequest, opts ...gax.CallOption) *AuthorizedCertificateIterator
ListAuthorizedCertificates lists all SSL certificates the user is authorized to administer.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" "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 := appengine.NewAuthorizedCertificatesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.ListAuthorizedCertificatesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListAuthorizedCertificatesRequest. } it := c.ListAuthorizedCertificates(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*appenginepb.ListAuthorizedCertificatesResponse) } }
Output:
func (*AuthorizedCertificatesClient) UpdateAuthorizedCertificate ¶
func (c *AuthorizedCertificatesClient) UpdateAuthorizedCertificate(ctx context.Context, req *appenginepb.UpdateAuthorizedCertificateRequest, opts ...gax.CallOption) (*appenginepb.AuthorizedCertificate, error)
UpdateAuthorizedCertificate updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewAuthorizedCertificatesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.UpdateAuthorizedCertificateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#UpdateAuthorizedCertificateRequest. } resp, err := c.UpdateAuthorizedCertificate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type AuthorizedDomainIterator ¶
type AuthorizedDomainIterator 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 []*appenginepb.AuthorizedDomain, nextPageToken string, err error) // contains filtered or unexported fields }
AuthorizedDomainIterator manages a stream of *appenginepb.AuthorizedDomain.
func (*AuthorizedDomainIterator) Next ¶
func (it *AuthorizedDomainIterator) Next() (*appenginepb.AuthorizedDomain, 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 (*AuthorizedDomainIterator) PageInfo ¶
func (it *AuthorizedDomainIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type AuthorizedDomainsCallOptions ¶
type AuthorizedDomainsCallOptions struct {
ListAuthorizedDomains []gax.CallOption
}
AuthorizedDomainsCallOptions contains the retry settings for each method of AuthorizedDomainsClient.
type AuthorizedDomainsClient ¶
type AuthorizedDomainsClient struct { // The call options for this service. CallOptions *AuthorizedDomainsCallOptions // contains filtered or unexported fields }
AuthorizedDomainsClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages domains a user is authorized to administer. To authorize use of a domain, verify ownership via Webmaster Central (at https://www.google.com/webmasters/verification/home).
func NewAuthorizedDomainsClient ¶
func NewAuthorizedDomainsClient(ctx context.Context, opts ...option.ClientOption) (*AuthorizedDomainsClient, error)
NewAuthorizedDomainsClient creates a new authorized domains client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages domains a user is authorized to administer. To authorize use of a domain, verify ownership via Webmaster Central (at https://www.google.com/webmasters/verification/home).
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewAuthorizedDomainsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewAuthorizedDomainsRESTClient ¶ added in v1.6.0
func NewAuthorizedDomainsRESTClient(ctx context.Context, opts ...option.ClientOption) (*AuthorizedDomainsClient, error)
NewAuthorizedDomainsRESTClient creates a new authorized domains rest client.
Manages domains a user is authorized to administer. To authorize use of a domain, verify ownership via Webmaster Central (at https://www.google.com/webmasters/verification/home).
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewAuthorizedDomainsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*AuthorizedDomainsClient) Close ¶
func (c *AuthorizedDomainsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AuthorizedDomainsClient) Connection
deprecated
func (c *AuthorizedDomainsClient) 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 (*AuthorizedDomainsClient) ListAuthorizedDomains ¶
func (c *AuthorizedDomainsClient) ListAuthorizedDomains(ctx context.Context, req *appenginepb.ListAuthorizedDomainsRequest, opts ...gax.CallOption) *AuthorizedDomainIterator
ListAuthorizedDomains lists all domains the user is authorized to administer.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" "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 := appengine.NewAuthorizedDomainsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.ListAuthorizedDomainsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListAuthorizedDomainsRequest. } it := c.ListAuthorizedDomains(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*appenginepb.ListAuthorizedDomainsResponse) } }
Output:
type CreateApplicationOperation ¶
type CreateApplicationOperation struct {
// contains filtered or unexported fields
}
CreateApplicationOperation manages a long-running operation from CreateApplication.
func (*CreateApplicationOperation) Done ¶
func (op *CreateApplicationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateApplicationOperation) Metadata ¶
func (op *CreateApplicationOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*CreateApplicationOperation) Name ¶
func (op *CreateApplicationOperation) 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 (*CreateApplicationOperation) Poll ¶
func (op *CreateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, 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 (*CreateApplicationOperation) Wait ¶
func (op *CreateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, 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 CreateDomainMappingOperation ¶
type CreateDomainMappingOperation struct {
// contains filtered or unexported fields
}
CreateDomainMappingOperation manages a long-running operation from CreateDomainMapping.
func (*CreateDomainMappingOperation) Done ¶
func (op *CreateDomainMappingOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateDomainMappingOperation) Metadata ¶
func (op *CreateDomainMappingOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*CreateDomainMappingOperation) Name ¶
func (op *CreateDomainMappingOperation) 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 (*CreateDomainMappingOperation) Poll ¶
func (op *CreateDomainMappingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, 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 (*CreateDomainMappingOperation) Wait ¶
func (op *CreateDomainMappingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, 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 CreateVersionOperation ¶
type CreateVersionOperation struct {
// contains filtered or unexported fields
}
CreateVersionOperation manages a long-running operation from CreateVersion.
func (*CreateVersionOperation) Done ¶
func (op *CreateVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateVersionOperation) Metadata ¶
func (op *CreateVersionOperation) Metadata() (*appenginepb.CreateVersionMetadataV1, 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 (*CreateVersionOperation) Name ¶
func (op *CreateVersionOperation) 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 (*CreateVersionOperation) Poll ¶
func (op *CreateVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, 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 (*CreateVersionOperation) Wait ¶
func (op *CreateVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, 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 DebugInstanceOperation ¶
type DebugInstanceOperation struct {
// contains filtered or unexported fields
}
DebugInstanceOperation manages a long-running operation from DebugInstance.
func (*DebugInstanceOperation) Done ¶
func (op *DebugInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DebugInstanceOperation) Metadata ¶
func (op *DebugInstanceOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*DebugInstanceOperation) Name ¶
func (op *DebugInstanceOperation) 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 (*DebugInstanceOperation) Poll ¶
func (op *DebugInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.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 (*DebugInstanceOperation) Wait ¶
func (op *DebugInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.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 DeleteDomainMappingOperation ¶
type DeleteDomainMappingOperation struct {
// contains filtered or unexported fields
}
DeleteDomainMappingOperation manages a long-running operation from DeleteDomainMapping.
func (*DeleteDomainMappingOperation) Done ¶
func (op *DeleteDomainMappingOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteDomainMappingOperation) Metadata ¶
func (op *DeleteDomainMappingOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*DeleteDomainMappingOperation) Name ¶
func (op *DeleteDomainMappingOperation) 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 (*DeleteDomainMappingOperation) Poll ¶
func (op *DeleteDomainMappingOperation) 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 (*DeleteDomainMappingOperation) Wait ¶
func (op *DeleteDomainMappingOperation) 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 DeleteInstanceOperation ¶
type DeleteInstanceOperation struct {
// contains filtered or unexported fields
}
DeleteInstanceOperation manages a long-running operation from DeleteInstance.
func (*DeleteInstanceOperation) Done ¶
func (op *DeleteInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteInstanceOperation) Metadata ¶
func (op *DeleteInstanceOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 ¶
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 ¶
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 ¶
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 DeleteServiceOperation ¶
type DeleteServiceOperation struct {
// contains filtered or unexported fields
}
DeleteServiceOperation manages a long-running operation from DeleteService.
func (*DeleteServiceOperation) Done ¶
func (op *DeleteServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteServiceOperation) Metadata ¶
func (op *DeleteServiceOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*DeleteServiceOperation) Name ¶
func (op *DeleteServiceOperation) 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 (*DeleteServiceOperation) Poll ¶
func (op *DeleteServiceOperation) 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 (*DeleteServiceOperation) Wait ¶
func (op *DeleteServiceOperation) 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 DeleteVersionOperation ¶
type DeleteVersionOperation struct {
// contains filtered or unexported fields
}
DeleteVersionOperation manages a long-running operation from DeleteVersion.
func (*DeleteVersionOperation) Done ¶
func (op *DeleteVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteVersionOperation) Metadata ¶
func (op *DeleteVersionOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*DeleteVersionOperation) Name ¶
func (op *DeleteVersionOperation) 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 (*DeleteVersionOperation) Poll ¶
func (op *DeleteVersionOperation) 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 (*DeleteVersionOperation) Wait ¶
func (op *DeleteVersionOperation) 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 DomainMappingIterator ¶
type DomainMappingIterator 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 []*appenginepb.DomainMapping, nextPageToken string, err error) // contains filtered or unexported fields }
DomainMappingIterator manages a stream of *appenginepb.DomainMapping.
func (*DomainMappingIterator) Next ¶
func (it *DomainMappingIterator) Next() (*appenginepb.DomainMapping, 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 (*DomainMappingIterator) PageInfo ¶
func (it *DomainMappingIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DomainMappingsCallOptions ¶
type DomainMappingsCallOptions struct { ListDomainMappings []gax.CallOption GetDomainMapping []gax.CallOption CreateDomainMapping []gax.CallOption UpdateDomainMapping []gax.CallOption DeleteDomainMapping []gax.CallOption }
DomainMappingsCallOptions contains the retry settings for each method of DomainMappingsClient.
type DomainMappingsClient ¶
type DomainMappingsClient struct { // The call options for this service. CallOptions *DomainMappingsCallOptions // 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 }
DomainMappingsClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages domains serving an application.
func NewDomainMappingsClient ¶
func NewDomainMappingsClient(ctx context.Context, opts ...option.ClientOption) (*DomainMappingsClient, error)
NewDomainMappingsClient creates a new domain mappings client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages domains serving an application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewDomainMappingsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewDomainMappingsRESTClient ¶ added in v1.6.0
func NewDomainMappingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*DomainMappingsClient, error)
NewDomainMappingsRESTClient creates a new domain mappings rest client.
Manages domains serving an application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewDomainMappingsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*DomainMappingsClient) Close ¶
func (c *DomainMappingsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DomainMappingsClient) Connection
deprecated
func (c *DomainMappingsClient) 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 (*DomainMappingsClient) CreateDomainMapping ¶
func (c *DomainMappingsClient) CreateDomainMapping(ctx context.Context, req *appenginepb.CreateDomainMappingRequest, opts ...gax.CallOption) (*CreateDomainMappingOperation, error)
CreateDomainMapping maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains (at ).
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewDomainMappingsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.CreateDomainMappingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#CreateDomainMappingRequest. } op, err := c.CreateDomainMapping(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 (*DomainMappingsClient) CreateDomainMappingOperation ¶
func (c *DomainMappingsClient) CreateDomainMappingOperation(name string) *CreateDomainMappingOperation
CreateDomainMappingOperation returns a new CreateDomainMappingOperation from a given name. The name must be that of a previously created CreateDomainMappingOperation, possibly from a different process.
func (*DomainMappingsClient) DeleteDomainMapping ¶
func (c *DomainMappingsClient) DeleteDomainMapping(ctx context.Context, req *appenginepb.DeleteDomainMappingRequest, opts ...gax.CallOption) (*DeleteDomainMappingOperation, error)
DeleteDomainMapping deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewDomainMappingsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.DeleteDomainMappingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#DeleteDomainMappingRequest. } op, err := c.DeleteDomainMapping(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*DomainMappingsClient) DeleteDomainMappingOperation ¶
func (c *DomainMappingsClient) DeleteDomainMappingOperation(name string) *DeleteDomainMappingOperation
DeleteDomainMappingOperation returns a new DeleteDomainMappingOperation from a given name. The name must be that of a previously created DeleteDomainMappingOperation, possibly from a different process.
func (*DomainMappingsClient) GetDomainMapping ¶
func (c *DomainMappingsClient) GetDomainMapping(ctx context.Context, req *appenginepb.GetDomainMappingRequest, opts ...gax.CallOption) (*appenginepb.DomainMapping, error)
GetDomainMapping gets the specified domain mapping.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewDomainMappingsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.GetDomainMappingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#GetDomainMappingRequest. } resp, err := c.GetDomainMapping(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*DomainMappingsClient) ListDomainMappings ¶
func (c *DomainMappingsClient) ListDomainMappings(ctx context.Context, req *appenginepb.ListDomainMappingsRequest, opts ...gax.CallOption) *DomainMappingIterator
ListDomainMappings lists the domain mappings on an application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" "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 := appengine.NewDomainMappingsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.ListDomainMappingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListDomainMappingsRequest. } it := c.ListDomainMappings(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*appenginepb.ListDomainMappingsResponse) } }
Output:
func (*DomainMappingsClient) UpdateDomainMapping ¶
func (c *DomainMappingsClient) UpdateDomainMapping(ctx context.Context, req *appenginepb.UpdateDomainMappingRequest, opts ...gax.CallOption) (*UpdateDomainMappingOperation, error)
UpdateDomainMapping updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewDomainMappingsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.UpdateDomainMappingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#UpdateDomainMappingRequest. } op, err := c.UpdateDomainMapping(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 (*DomainMappingsClient) UpdateDomainMappingOperation ¶
func (c *DomainMappingsClient) UpdateDomainMappingOperation(name string) *UpdateDomainMappingOperation
UpdateDomainMappingOperation returns a new UpdateDomainMappingOperation from a given name. The name must be that of a previously created UpdateDomainMappingOperation, possibly from a different process.
type FirewallCallOptions ¶
type FirewallCallOptions struct { ListIngressRules []gax.CallOption BatchUpdateIngressRules []gax.CallOption CreateIngressRule []gax.CallOption GetIngressRule []gax.CallOption UpdateIngressRule []gax.CallOption DeleteIngressRule []gax.CallOption }
FirewallCallOptions contains the retry settings for each method of FirewallClient.
type FirewallClient ¶
type FirewallClient struct { // The call options for this service. CallOptions *FirewallCallOptions // contains filtered or unexported fields }
FirewallClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Firewall resources are used to define a collection of access control rules for an Application. Each rule is defined with a position which specifies the rule’s order in the sequence of rules, an IP range to be matched against requests, and an action to take upon matching requests.
Every request is evaluated against the Firewall rules in priority order. Processesing stops at the first rule which matches the request’s IP address. A final rule always specifies an action that applies to all remaining IP addresses. The default final rule for a newly-created application will be set to “allow” if not otherwise specified by the user.
func NewFirewallClient ¶
func NewFirewallClient(ctx context.Context, opts ...option.ClientOption) (*FirewallClient, error)
NewFirewallClient creates a new firewall client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Firewall resources are used to define a collection of access control rules for an Application. Each rule is defined with a position which specifies the rule’s order in the sequence of rules, an IP range to be matched against requests, and an action to take upon matching requests.
Every request is evaluated against the Firewall rules in priority order. Processesing stops at the first rule which matches the request’s IP address. A final rule always specifies an action that applies to all remaining IP addresses. The default final rule for a newly-created application will be set to “allow” if not otherwise specified by the user.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewFirewallClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewFirewallRESTClient ¶ added in v1.6.0
func NewFirewallRESTClient(ctx context.Context, opts ...option.ClientOption) (*FirewallClient, error)
NewFirewallRESTClient creates a new firewall rest client.
Firewall resources are used to define a collection of access control rules for an Application. Each rule is defined with a position which specifies the rule’s order in the sequence of rules, an IP range to be matched against requests, and an action to take upon matching requests.
Every request is evaluated against the Firewall rules in priority order. Processesing stops at the first rule which matches the request’s IP address. A final rule always specifies an action that applies to all remaining IP addresses. The default final rule for a newly-created application will be set to “allow” if not otherwise specified by the user.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewFirewallRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*FirewallClient) BatchUpdateIngressRules ¶
func (c *FirewallClient) BatchUpdateIngressRules(ctx context.Context, req *appenginepb.BatchUpdateIngressRulesRequest, opts ...gax.CallOption) (*appenginepb.BatchUpdateIngressRulesResponse, error)
BatchUpdateIngressRules replaces the entire firewall ruleset in one bulk operation. This overrides and replaces the rules of an existing firewall with the new rules.
If the final rule does not match traffic with the ‘*’ wildcard IP range, then an “allow all” rule is explicitly added to the end of the list.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewFirewallClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.BatchUpdateIngressRulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#BatchUpdateIngressRulesRequest. } resp, err := c.BatchUpdateIngressRules(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*FirewallClient) Close ¶
func (c *FirewallClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*FirewallClient) Connection
deprecated
func (c *FirewallClient) 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 (*FirewallClient) CreateIngressRule ¶
func (c *FirewallClient) CreateIngressRule(ctx context.Context, req *appenginepb.CreateIngressRuleRequest, opts ...gax.CallOption) (*appenginepb.FirewallRule, error)
CreateIngressRule creates a firewall rule for the application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewFirewallClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.CreateIngressRuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#CreateIngressRuleRequest. } resp, err := c.CreateIngressRule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*FirewallClient) DeleteIngressRule ¶
func (c *FirewallClient) DeleteIngressRule(ctx context.Context, req *appenginepb.DeleteIngressRuleRequest, opts ...gax.CallOption) error
DeleteIngressRule deletes the specified firewall rule.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewFirewallClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.DeleteIngressRuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#DeleteIngressRuleRequest. } err = c.DeleteIngressRule(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*FirewallClient) GetIngressRule ¶
func (c *FirewallClient) GetIngressRule(ctx context.Context, req *appenginepb.GetIngressRuleRequest, opts ...gax.CallOption) (*appenginepb.FirewallRule, error)
GetIngressRule gets the specified firewall rule.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewFirewallClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.GetIngressRuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#GetIngressRuleRequest. } resp, err := c.GetIngressRule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*FirewallClient) ListIngressRules ¶
func (c *FirewallClient) ListIngressRules(ctx context.Context, req *appenginepb.ListIngressRulesRequest, opts ...gax.CallOption) *FirewallRuleIterator
ListIngressRules lists the firewall rules of an application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" "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 := appengine.NewFirewallClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.ListIngressRulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListIngressRulesRequest. } it := c.ListIngressRules(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*appenginepb.ListIngressRulesResponse) } }
Output:
func (*FirewallClient) UpdateIngressRule ¶
func (c *FirewallClient) UpdateIngressRule(ctx context.Context, req *appenginepb.UpdateIngressRuleRequest, opts ...gax.CallOption) (*appenginepb.FirewallRule, error)
UpdateIngressRule updates the specified firewall rule.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewFirewallClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.UpdateIngressRuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#UpdateIngressRuleRequest. } resp, err := c.UpdateIngressRule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type FirewallRuleIterator ¶
type FirewallRuleIterator 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 []*appenginepb.FirewallRule, nextPageToken string, err error) // contains filtered or unexported fields }
FirewallRuleIterator manages a stream of *appenginepb.FirewallRule.
func (*FirewallRuleIterator) Next ¶
func (it *FirewallRuleIterator) Next() (*appenginepb.FirewallRule, 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 (*FirewallRuleIterator) PageInfo ¶
func (it *FirewallRuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstanceIterator ¶
type InstanceIterator 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 []*appenginepb.Instance, nextPageToken string, err error) // contains filtered or unexported fields }
InstanceIterator manages a stream of *appenginepb.Instance.
func (*InstanceIterator) Next ¶
func (it *InstanceIterator) Next() (*appenginepb.Instance, 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 (*InstanceIterator) PageInfo ¶
func (it *InstanceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type InstancesCallOptions ¶
type InstancesCallOptions struct { ListInstances []gax.CallOption GetInstance []gax.CallOption DeleteInstance []gax.CallOption DebugInstance []gax.CallOption }
InstancesCallOptions contains the retry settings for each method of InstancesClient.
type InstancesClient ¶
type InstancesClient struct { // The call options for this service. CallOptions *InstancesCallOptions // 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 }
InstancesClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages instances of a version.
func NewInstancesClient ¶
func NewInstancesClient(ctx context.Context, opts ...option.ClientOption) (*InstancesClient, error)
NewInstancesClient creates a new instances client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages instances of a version.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewInstancesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewInstancesRESTClient ¶ added in v1.6.0
func NewInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstancesClient, error)
NewInstancesRESTClient creates a new instances rest client.
Manages instances of a version.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewInstancesRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*InstancesClient) Close ¶
func (c *InstancesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstancesClient) Connection
deprecated
func (c *InstancesClient) 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 (*InstancesClient) DebugInstance ¶
func (c *InstancesClient) DebugInstance(ctx context.Context, req *appenginepb.DebugInstanceRequest, opts ...gax.CallOption) (*DebugInstanceOperation, error)
DebugInstance enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in “debug mode”, the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.
Only applicable for instances in App Engine flexible environment.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewInstancesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.DebugInstanceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#DebugInstanceRequest. } op, err := c.DebugInstance(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 (*InstancesClient) DebugInstanceOperation ¶
func (c *InstancesClient) DebugInstanceOperation(name string) *DebugInstanceOperation
DebugInstanceOperation returns a new DebugInstanceOperation from a given name. The name must be that of a previously created DebugInstanceOperation, possibly from a different process.
func (*InstancesClient) DeleteInstance ¶
func (c *InstancesClient) DeleteInstance(ctx context.Context, req *appenginepb.DeleteInstanceRequest, opts ...gax.CallOption) (*DeleteInstanceOperation, error)
DeleteInstance stops a running instance.
The instance might be automatically recreated based on the scaling settings of the version. For more information, see “How Instances are Managed” (standard environment (at https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | flexible environment (at https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).
To ensure that instances are not re-created and avoid getting billed, you can stop all instances within the target version by changing the serving status of the version to STOPPED with the apps.services.versions.patch (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) method.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewInstancesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.DeleteInstanceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#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 (*InstancesClient) DeleteInstanceOperation ¶
func (c *InstancesClient) 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 (*InstancesClient) GetInstance ¶
func (c *InstancesClient) GetInstance(ctx context.Context, req *appenginepb.GetInstanceRequest, opts ...gax.CallOption) (*appenginepb.Instance, error)
GetInstance gets instance information.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewInstancesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.GetInstanceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#GetInstanceRequest. } resp, err := c.GetInstance(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*InstancesClient) ListInstances ¶
func (c *InstancesClient) ListInstances(ctx context.Context, req *appenginepb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator
ListInstances lists the instances of a version.
Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (at https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" "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 := appengine.NewInstancesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.ListInstancesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListInstancesRequest. } it := c.ListInstances(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*appenginepb.ListInstancesResponse) } }
Output:
type RepairApplicationOperation ¶
type RepairApplicationOperation struct {
// contains filtered or unexported fields
}
RepairApplicationOperation manages a long-running operation from RepairApplication.
func (*RepairApplicationOperation) Done ¶
func (op *RepairApplicationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RepairApplicationOperation) Metadata ¶
func (op *RepairApplicationOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*RepairApplicationOperation) Name ¶
func (op *RepairApplicationOperation) 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 (*RepairApplicationOperation) Poll ¶
func (op *RepairApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, 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 (*RepairApplicationOperation) Wait ¶
func (op *RepairApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, 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 ServiceIterator ¶
type ServiceIterator 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 []*appenginepb.Service, nextPageToken string, err error) // contains filtered or unexported fields }
ServiceIterator manages a stream of *appenginepb.Service.
func (*ServiceIterator) Next ¶
func (it *ServiceIterator) Next() (*appenginepb.Service, 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 (*ServiceIterator) PageInfo ¶
func (it *ServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ServicesCallOptions ¶
type ServicesCallOptions struct { ListServices []gax.CallOption GetService []gax.CallOption UpdateService []gax.CallOption DeleteService []gax.CallOption }
ServicesCallOptions contains the retry settings for each method of ServicesClient.
type ServicesClient ¶
type ServicesClient struct { // The call options for this service. CallOptions *ServicesCallOptions // 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 }
ServicesClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages services of an application.
func NewServicesClient ¶
func NewServicesClient(ctx context.Context, opts ...option.ClientOption) (*ServicesClient, error)
NewServicesClient creates a new services client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages services of an application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewServicesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewServicesRESTClient ¶ added in v1.6.0
func NewServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ServicesClient, error)
NewServicesRESTClient creates a new services rest client.
Manages services of an application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewServicesRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ServicesClient) Close ¶
func (c *ServicesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ServicesClient) Connection
deprecated
func (c *ServicesClient) 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 (*ServicesClient) DeleteService ¶
func (c *ServicesClient) DeleteService(ctx context.Context, req *appenginepb.DeleteServiceRequest, opts ...gax.CallOption) (*DeleteServiceOperation, error)
DeleteService deletes the specified service and all enclosed versions.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewServicesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.DeleteServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#DeleteServiceRequest. } op, err := c.DeleteService(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*ServicesClient) DeleteServiceOperation ¶
func (c *ServicesClient) DeleteServiceOperation(name string) *DeleteServiceOperation
DeleteServiceOperation returns a new DeleteServiceOperation from a given name. The name must be that of a previously created DeleteServiceOperation, possibly from a different process.
func (*ServicesClient) GetService ¶
func (c *ServicesClient) GetService(ctx context.Context, req *appenginepb.GetServiceRequest, opts ...gax.CallOption) (*appenginepb.Service, error)
GetService gets the current configuration of the specified service.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewServicesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.GetServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#GetServiceRequest. } resp, err := c.GetService(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServicesClient) ListServices ¶
func (c *ServicesClient) ListServices(ctx context.Context, req *appenginepb.ListServicesRequest, opts ...gax.CallOption) *ServiceIterator
ListServices lists all the services in the application.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" "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 := appengine.NewServicesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.ListServicesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListServicesRequest. } it := c.ListServices(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*appenginepb.ListServicesResponse) } }
Output:
func (*ServicesClient) UpdateService ¶
func (c *ServicesClient) UpdateService(ctx context.Context, req *appenginepb.UpdateServiceRequest, opts ...gax.CallOption) (*UpdateServiceOperation, error)
UpdateService updates the configuration of the specified service.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewServicesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.UpdateServiceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#UpdateServiceRequest. } op, err := c.UpdateService(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 (*ServicesClient) UpdateServiceOperation ¶
func (c *ServicesClient) UpdateServiceOperation(name string) *UpdateServiceOperation
UpdateServiceOperation returns a new UpdateServiceOperation from a given name. The name must be that of a previously created UpdateServiceOperation, possibly from a different process.
type UpdateApplicationOperation ¶
type UpdateApplicationOperation struct {
// contains filtered or unexported fields
}
UpdateApplicationOperation manages a long-running operation from UpdateApplication.
func (*UpdateApplicationOperation) Done ¶
func (op *UpdateApplicationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateApplicationOperation) Metadata ¶
func (op *UpdateApplicationOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*UpdateApplicationOperation) Name ¶
func (op *UpdateApplicationOperation) 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 (*UpdateApplicationOperation) Poll ¶
func (op *UpdateApplicationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, 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 (*UpdateApplicationOperation) Wait ¶
func (op *UpdateApplicationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Application, 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 UpdateDomainMappingOperation ¶
type UpdateDomainMappingOperation struct {
// contains filtered or unexported fields
}
UpdateDomainMappingOperation manages a long-running operation from UpdateDomainMapping.
func (*UpdateDomainMappingOperation) Done ¶
func (op *UpdateDomainMappingOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateDomainMappingOperation) Metadata ¶
func (op *UpdateDomainMappingOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*UpdateDomainMappingOperation) Name ¶
func (op *UpdateDomainMappingOperation) 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 (*UpdateDomainMappingOperation) Poll ¶
func (op *UpdateDomainMappingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, 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 (*UpdateDomainMappingOperation) Wait ¶
func (op *UpdateDomainMappingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.DomainMapping, 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 UpdateServiceOperation ¶
type UpdateServiceOperation struct {
// contains filtered or unexported fields
}
UpdateServiceOperation manages a long-running operation from UpdateService.
func (*UpdateServiceOperation) Done ¶
func (op *UpdateServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateServiceOperation) Metadata ¶
func (op *UpdateServiceOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*UpdateServiceOperation) Name ¶
func (op *UpdateServiceOperation) 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 (*UpdateServiceOperation) Poll ¶
func (op *UpdateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Service, 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 (*UpdateServiceOperation) Wait ¶
func (op *UpdateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Service, 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 UpdateVersionOperation ¶
type UpdateVersionOperation struct {
// contains filtered or unexported fields
}
UpdateVersionOperation manages a long-running operation from UpdateVersion.
func (*UpdateVersionOperation) Done ¶
func (op *UpdateVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateVersionOperation) Metadata ¶
func (op *UpdateVersionOperation) Metadata() (*appenginepb.OperationMetadataV1, 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 (*UpdateVersionOperation) Name ¶
func (op *UpdateVersionOperation) 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 (*UpdateVersionOperation) Poll ¶
func (op *UpdateVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, 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 (*UpdateVersionOperation) Wait ¶
func (op *UpdateVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*appenginepb.Version, 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 VersionIterator ¶
type VersionIterator 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 []*appenginepb.Version, nextPageToken string, err error) // contains filtered or unexported fields }
VersionIterator manages a stream of *appenginepb.Version.
func (*VersionIterator) Next ¶
func (it *VersionIterator) Next() (*appenginepb.Version, 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 (*VersionIterator) PageInfo ¶
func (it *VersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VersionsCallOptions ¶
type VersionsCallOptions struct { ListVersions []gax.CallOption GetVersion []gax.CallOption CreateVersion []gax.CallOption UpdateVersion []gax.CallOption DeleteVersion []gax.CallOption }
VersionsCallOptions contains the retry settings for each method of VersionsClient.
type VersionsClient ¶
type VersionsClient struct { // The call options for this service. CallOptions *VersionsCallOptions // 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 }
VersionsClient is a client for interacting with App Engine Admin API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages versions of a service.
func NewVersionsClient ¶
func NewVersionsClient(ctx context.Context, opts ...option.ClientOption) (*VersionsClient, error)
NewVersionsClient creates a new versions client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages versions of a service.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewVersionsRESTClient ¶ added in v1.6.0
func NewVersionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*VersionsClient, error)
NewVersionsRESTClient creates a new versions rest client.
Manages versions of a service.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" ) 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 := appengine.NewVersionsRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*VersionsClient) Close ¶
func (c *VersionsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*VersionsClient) Connection
deprecated
func (c *VersionsClient) 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 (*VersionsClient) CreateVersion ¶
func (c *VersionsClient) CreateVersion(ctx context.Context, req *appenginepb.CreateVersionRequest, opts ...gax.CallOption) (*CreateVersionOperation, error)
CreateVersion deploys code and resource files to a new version.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.CreateVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#CreateVersionRequest. } op, err := c.CreateVersion(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 (*VersionsClient) CreateVersionOperation ¶
func (c *VersionsClient) CreateVersionOperation(name string) *CreateVersionOperation
CreateVersionOperation returns a new CreateVersionOperation from a given name. The name must be that of a previously created CreateVersionOperation, possibly from a different process.
func (*VersionsClient) DeleteVersion ¶
func (c *VersionsClient) DeleteVersion(ctx context.Context, req *appenginepb.DeleteVersionRequest, opts ...gax.CallOption) (*DeleteVersionOperation, error)
DeleteVersion deletes an existing Version resource.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.DeleteVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#DeleteVersionRequest. } op, err := c.DeleteVersion(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*VersionsClient) DeleteVersionOperation ¶
func (c *VersionsClient) DeleteVersionOperation(name string) *DeleteVersionOperation
DeleteVersionOperation returns a new DeleteVersionOperation from a given name. The name must be that of a previously created DeleteVersionOperation, possibly from a different process.
func (*VersionsClient) GetVersion ¶
func (c *VersionsClient) GetVersion(ctx context.Context, req *appenginepb.GetVersionRequest, opts ...gax.CallOption) (*appenginepb.Version, error)
GetVersion gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.GetVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#GetVersionRequest. } resp, err := c.GetVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*VersionsClient) ListVersions ¶
func (c *VersionsClient) ListVersions(ctx context.Context, req *appenginepb.ListVersionsRequest, opts ...gax.CallOption) *VersionIterator
ListVersions lists the versions of a service.
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" "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 := appengine.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.ListVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListVersionsRequest. } it := c.ListVersions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*appenginepb.ListVersionsResponse) } }
Output:
func (*VersionsClient) UpdateVersion ¶
func (c *VersionsClient) UpdateVersion(ctx context.Context, req *appenginepb.UpdateVersionRequest, opts ...gax.CallOption) (*UpdateVersionOperation, error)
UpdateVersion updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:
Standard environment
instance_class (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class)
automatic scaling in the standard environment:
automatic_scaling.min_idle_instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.max_idle_instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automaticScaling.standard_scheduler_settings.max_instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.min_instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.target_cpu_utilization (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.target_throughput_utilization (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
basic scaling or manual scaling in the standard environment:
serving_status (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) manual_scaling.instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
Flexible environment
serving_status (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
automatic scaling in the flexible environment:
automatic_scaling.min_total_instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.max_total_instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.cool_down_period_sec (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.cpu_utilization.target_utilization (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
manual scaling in the flexible environment:
manual_scaling.instances (at https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
Example ¶
package main import ( "context" appengine "cloud.google.com/go/appengine/apiv1" appenginepb "cloud.google.com/go/appengine/apiv1/appenginepb" ) 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 := appengine.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &appenginepb.UpdateVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#UpdateVersionRequest. } op, err := c.UpdateVersion(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 (*VersionsClient) UpdateVersionOperation ¶
func (c *VersionsClient) UpdateVersionOperation(name string) *UpdateVersionOperation
UpdateVersionOperation returns a new UpdateVersionOperation from a given name. The name must be that of a previously created UpdateVersionOperation, possibly from a different process.