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.
// go get cloud.google.com/go/appengine/apiv1@latest 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, mentioned above.
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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
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.
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
}
func NewApplicationsRESTClient
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
}
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
}
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
}
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
}
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
}
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.
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) All
func (it *AuthorizedCertificateIterator) All() iter.Seq2[*appenginepb.AuthorizedCertificate, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
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.
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
}
func NewAuthorizedCertificatesRESTClient
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
}
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
}
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.
}
}
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
}
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.
Examples
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)
}
}
all
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.ListAuthorizedCertificatesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/appengine/apiv1/appenginepb#ListAuthorizedCertificatesRequest.
}
for resp, err := range c.ListAuthorizedCertificates(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
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
}
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) All
func (it *AuthorizedDomainIterator) All() iter.Seq2[*appenginepb.AuthorizedDomain, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
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.
AuthorizedDomainsCallOptions
type AuthorizedDomainsCallOptions struct {
ListAuthorizedDomains []gax.CallOption
}
AuthorizedDomainsCallOptions contains the retry settings for each method of AuthorizedDomainsClient.
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
}
func NewAuthorizedDomainsRESTClient
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
}
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.
Examples
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)
}
}
all
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.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.
}
for resp, err := range c.ListAuthorizedDomains(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
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.
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.
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.
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.
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)