Package cloudcontrolspartner is an auto-generated package for the Cloud Controls Partner API.
Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering.
NOTE : This package is in beta . It is not stable , and may be subject to changes .
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/cloudcontrolspartner/apiv1beta@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 := cloudcontrolspartner . NewCloudControlsPartnerCoreClient ( 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 := & cloudcontrolspartnerpb . CreateCustomerRequest { // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#CreateCustomerRequest. } resp , err := c . CreateCustomer ( ctx , req ) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewCloudControlsPartnerCoreClient 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.
AccessApprovalRequestIterator
type
AccessApprovalRequestIterator
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
[]
*
cloudcontrolspartnerpb
.
AccessApprovalRequest
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
AccessApprovalRequestIterator manages a stream of *cloudcontrolspartnerpb.AccessApprovalRequest.
func (*AccessApprovalRequestIterator) All
func
(
it
*
AccessApprovalRequestIterator
)
All
()
iter
.
Seq2
[
*
cloudcontrolspartnerpb
.
AccessApprovalRequest
,
error
]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AccessApprovalRequestIterator) Next
func
(
it
*
AccessApprovalRequestIterator
)
Next
()
(
*
cloudcontrolspartnerpb
.
AccessApprovalRequest
,
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 (*AccessApprovalRequestIterator) PageInfo
func
(
it
*
AccessApprovalRequestIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CloudControlsPartnerCoreCallOptions
type
CloudControlsPartnerCoreCallOptions
struct
{
GetWorkload
[]
gax
.
CallOption
ListWorkloads
[]
gax
.
CallOption
GetCustomer
[]
gax
.
CallOption
ListCustomers
[]
gax
.
CallOption
GetEkmConnections
[]
gax
.
CallOption
GetPartnerPermissions
[]
gax
.
CallOption
ListAccessApprovalRequests
[]
gax
.
CallOption
GetPartner
[]
gax
.
CallOption
CreateCustomer
[]
gax
.
CallOption
UpdateCustomer
[]
gax
.
CallOption
DeleteCustomer
[]
gax
.
CallOption
}
CloudControlsPartnerCoreCallOptions contains the retry settings for each method of CloudControlsPartnerCoreClient.
CloudControlsPartnerCoreClient
type
CloudControlsPartnerCoreClient
struct
{
// The call options for this service.
CallOptions
*
CloudControlsPartnerCoreCallOptions
// contains filtered or unexported fields
}
CloudControlsPartnerCoreClient is a client for interacting with Cloud Controls Partner API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources
func NewCloudControlsPartnerCoreClient
func
NewCloudControlsPartnerCoreClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
CloudControlsPartnerCoreClient
,
error
)
NewCloudControlsPartnerCoreClient creates a new cloud controls partner core client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing handlers for resources
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func NewCloudControlsPartnerCoreRESTClient
func
NewCloudControlsPartnerCoreRESTClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
CloudControlsPartnerCoreClient
,
error
)
NewCloudControlsPartnerCoreRESTClient creates a new cloud controls partner core rest client.
Service describing handlers for resources
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreRESTClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func (*CloudControlsPartnerCoreClient) Close
func
(
c
*
CloudControlsPartnerCoreClient
)
Close
()
error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*CloudControlsPartnerCoreClient) Connection (deprecated)
func
(
c
*
CloudControlsPartnerCoreClient
)
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 (*CloudControlsPartnerCoreClient) CreateCustomer
func
(
c
*
CloudControlsPartnerCoreClient
)
CreateCustomer
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
CreateCustomerRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
Customer
,
error
)
CreateCustomer creates a new customer.
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
CreateCustomerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#CreateCustomerRequest.
}
resp
,
err
:=
c
.
CreateCustomer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*CloudControlsPartnerCoreClient) DeleteCustomer
func
(
c
*
CloudControlsPartnerCoreClient
)
DeleteCustomer
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
DeleteCustomerRequest
,
opts
...
gax
.
CallOption
)
error
DeleteCustomer delete details of a single customer
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
DeleteCustomerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#DeleteCustomerRequest.
}
err
=
c
.
DeleteCustomer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*CloudControlsPartnerCoreClient) GetCustomer
func
(
c
*
CloudControlsPartnerCoreClient
)
GetCustomer
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
GetCustomerRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
Customer
,
error
)
GetCustomer gets details of a single customer
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
GetCustomerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetCustomerRequest.
}
resp
,
err
:=
c
.
GetCustomer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*CloudControlsPartnerCoreClient) GetEkmConnections
func
(
c
*
CloudControlsPartnerCoreClient
)
GetEkmConnections
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
GetEkmConnectionsRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
EkmConnections
,
error
)
GetEkmConnections gets the EKM connections associated with a workload
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
GetEkmConnectionsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetEkmConnectionsRequest.
}
resp
,
err
:=
c
.
GetEkmConnections
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*CloudControlsPartnerCoreClient) GetPartner
func
(
c
*
CloudControlsPartnerCoreClient
)
GetPartner
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
GetPartnerRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
Partner
,
error
)
GetPartner get details of a Partner.
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
GetPartnerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetPartnerRequest.
}
resp
,
err
:=
c
.
GetPartner
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*CloudControlsPartnerCoreClient) GetPartnerPermissions
func
(
c
*
CloudControlsPartnerCoreClient
)
GetPartnerPermissions
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
GetPartnerPermissionsRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
PartnerPermissions
,
error
)
GetPartnerPermissions gets the partner permissions granted for a workload
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
GetPartnerPermissionsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetPartnerPermissionsRequest.
}
resp
,
err
:=
c
.
GetPartnerPermissions
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*CloudControlsPartnerCoreClient) GetWorkload
func
(
c
*
CloudControlsPartnerCoreClient
)
GetWorkload
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
GetWorkloadRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
Workload
,
error
)
GetWorkload gets details of a single workload
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
GetWorkloadRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetWorkloadRequest.
}
resp
,
err
:=
c
.
GetWorkload
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*CloudControlsPartnerCoreClient) ListAccessApprovalRequests (deprecated)
func
(
c
*
CloudControlsPartnerCoreClient
)
ListAccessApprovalRequests
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
ListAccessApprovalRequestsRequest
,
opts
...
gax
.
CallOption
)
*
AccessApprovalRequestIterator
ListAccessApprovalRequests deprecated: Only returns access approval requests directly associated with an assured workload folder.
Deprecated: ListAccessApprovalRequests may be removed in a future version.
Examples
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
"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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListAccessApprovalRequestsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListAccessApprovalRequestsRequest.
}
it
:=
c
.
ListAccessApprovalRequests
(
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
.(
*
cloudcontrolspartnerpb
.
ListAccessApprovalRequestsResponse
)
}
}
all
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListAccessApprovalRequestsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListAccessApprovalRequestsRequest.
}
for
resp
,
err
:=
range
c
.
ListAccessApprovalRequests
(
ctx
,
req
).
All
()
{
if
err
!=
nil
{
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*CloudControlsPartnerCoreClient) ListCustomers
func
(
c
*
CloudControlsPartnerCoreClient
)
ListCustomers
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
ListCustomersRequest
,
opts
...
gax
.
CallOption
)
*
CustomerIterator
ListCustomers lists customers of a partner identified by its Google Cloud organization ID
Examples
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
"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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListCustomersRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListCustomersRequest.
}
it
:=
c
.
ListCustomers
(
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
.(
*
cloudcontrolspartnerpb
.
ListCustomersResponse
)
}
}
all
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListCustomersRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListCustomersRequest.
}
for
resp
,
err
:=
range
c
.
ListCustomers
(
ctx
,
req
).
All
()
{
if
err
!=
nil
{
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*CloudControlsPartnerCoreClient) ListWorkloads
func
(
c
*
CloudControlsPartnerCoreClient
)
ListWorkloads
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
ListWorkloadsRequest
,
opts
...
gax
.
CallOption
)
*
WorkloadIterator
ListWorkloads lists customer workloads for a given customer org id
Examples
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
"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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListWorkloadsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListWorkloadsRequest.
}
it
:=
c
.
ListWorkloads
(
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
.(
*
cloudcontrolspartnerpb
.
ListWorkloadsResponse
)
}
}
all
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListWorkloadsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListWorkloadsRequest.
}
for
resp
,
err
:=
range
c
.
ListWorkloads
(
ctx
,
req
).
All
()
{
if
err
!=
nil
{
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*CloudControlsPartnerCoreClient) UpdateCustomer
func
(
c
*
CloudControlsPartnerCoreClient
)
UpdateCustomer
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
UpdateCustomerRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
Customer
,
error
)
UpdateCustomer update details of a single customer
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerCoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
UpdateCustomerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#UpdateCustomerRequest.
}
resp
,
err
:=
c
.
UpdateCustomer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
CloudControlsPartnerMonitoringCallOptions
type
CloudControlsPartnerMonitoringCallOptions
struct
{
ListViolations
[]
gax
.
CallOption
GetViolation
[]
gax
.
CallOption
}
CloudControlsPartnerMonitoringCallOptions contains the retry settings for each method of CloudControlsPartnerMonitoringClient.
CloudControlsPartnerMonitoringClient
type
CloudControlsPartnerMonitoringClient
struct
{
// The call options for this service.
CallOptions
*
CloudControlsPartnerMonitoringCallOptions
// contains filtered or unexported fields
}
CloudControlsPartnerMonitoringClient is a client for interacting with Cloud Controls Partner API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources
func NewCloudControlsPartnerMonitoringClient
func
NewCloudControlsPartnerMonitoringClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
CloudControlsPartnerMonitoringClient
,
error
)
NewCloudControlsPartnerMonitoringClient creates a new cloud controls partner monitoring client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing handlers for resources
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerMonitoringClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func NewCloudControlsPartnerMonitoringRESTClient
func
NewCloudControlsPartnerMonitoringRESTClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
CloudControlsPartnerMonitoringClient
,
error
)
NewCloudControlsPartnerMonitoringRESTClient creates a new cloud controls partner monitoring rest client.
Service describing handlers for resources
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerMonitoringRESTClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func (*CloudControlsPartnerMonitoringClient) Close
func
(
c
*
CloudControlsPartnerMonitoringClient
)
Close
()
error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*CloudControlsPartnerMonitoringClient) Connection (deprecated)
func
(
c
*
CloudControlsPartnerMonitoringClient
)
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 (*CloudControlsPartnerMonitoringClient) GetViolation
func
(
c
*
CloudControlsPartnerMonitoringClient
)
GetViolation
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
GetViolationRequest
,
opts
...
gax
.
CallOption
)
(
*
cloudcontrolspartnerpb
.
Violation
,
error
)
GetViolation gets details of a single Violation.
Example
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerMonitoringClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
GetViolationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetViolationRequest.
}
resp
,
err
:=
c
.
GetViolation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*CloudControlsPartnerMonitoringClient) ListViolations
func
(
c
*
CloudControlsPartnerMonitoringClient
)
ListViolations
(
ctx
context
.
Context
,
req
*
cloudcontrolspartnerpb
.
ListViolationsRequest
,
opts
...
gax
.
CallOption
)
*
ViolationIterator
ListViolations lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 (at https://google.aip.dev/159 ) by using ‘-’ (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
Examples
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
"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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerMonitoringClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListViolationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListViolationsRequest.
}
it
:=
c
.
ListViolations
(
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
.(
*
cloudcontrolspartnerpb
.
ListViolationsResponse
)
}
}
all
package
main
import
(
"context"
cloudcontrolspartner
"cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb
"cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
)
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
:=
cloudcontrolspartner
.
NewCloudControlsPartnerMonitoringClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& cloudcontrolspartnerpb
.
ListViolationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListViolationsRequest.
}
for
resp
,
err
:=
range
c
.
ListViolations
(
ctx
,
req
).
All
()
{
if
err
!=
nil
{
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_
=
resp
}
}
CustomerIterator
type
CustomerIterator
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
[]
*
cloudcontrolspartnerpb
.
Customer
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
CustomerIterator manages a stream of *cloudcontrolspartnerpb.Customer.
func (*CustomerIterator) All
func
(
it
*
CustomerIterator
)
All
()
iter
.
Seq2
[
*
cloudcontrolspartnerpb
.
Customer
,
error
]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CustomerIterator) Next
func
(
it
*
CustomerIterator
)
Next
()
(
*
cloudcontrolspartnerpb
.
Customer
,
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 (*CustomerIterator) PageInfo
func
(
it
*
CustomerIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ViolationIterator
type
ViolationIterator
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
[]
*
cloudcontrolspartnerpb
.
Violation
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
ViolationIterator manages a stream of *cloudcontrolspartnerpb.Violation.
func (*ViolationIterator) All
func
(
it
*
ViolationIterator
)
All
()
iter
.
Seq2
[
*
cloudcontrolspartnerpb
.
Violation
,
error
]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ViolationIterator) Next
func
(
it
*
ViolationIterator
)
Next
()
(
*
cloudcontrolspartnerpb
.
Violation
,
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 (*ViolationIterator) PageInfo
func
(
it
*
ViolationIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
WorkloadIterator
type
WorkloadIterator
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
[]
*
cloudcontrolspartnerpb
.
Workload
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
WorkloadIterator manages a stream of *cloudcontrolspartnerpb.Workload.
func (*WorkloadIterator) All
func
(
it
*
WorkloadIterator
)
All
()
iter
.
Seq2
[
*
cloudcontrolspartnerpb
.
Workload
,
error
]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*WorkloadIterator) Next
func
(
it
*
WorkloadIterator
)
Next
()
(
*
cloudcontrolspartnerpb
.
Workload
,
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 (*WorkloadIterator) PageInfo
func
(
it
*
WorkloadIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.