cloudcontrolspartner

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

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:

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 := 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.

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

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.

Index

Examples

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 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 added in v1.1.0

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*AccessApprovalRequestIterator) Next

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

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type 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
}

CloudControlsPartnerCoreCallOptions contains the retry settings for each method of CloudControlsPartnerCoreClient.

type 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
}
Output:

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
}
Output:

func (*CloudControlsPartnerCoreClient) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*CloudControlsPartnerCoreClient) Connection deprecated

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) GetCustomer

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
}
Output:

func (*CloudControlsPartnerCoreClient) GetEkmConnections

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
}
Output:

func (*CloudControlsPartnerCoreClient) GetPartner

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
}
Output:

func (*CloudControlsPartnerCoreClient) GetPartnerPermissions

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
}
Output:

func (*CloudControlsPartnerCoreClient) GetWorkload

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
}
Output:

func (*CloudControlsPartnerCoreClient) ListAccessApprovalRequests deprecated

ListAccessApprovalRequests deprecated: Only returns access approval requests directly associated with an assured workload folder.

Deprecated: ListAccessApprovalRequests may be removed in a future version.

Example
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)
	}
}
Output:

Example (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.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*CloudControlsPartnerCoreClient) ListCustomers

ListCustomers lists customers of a partner identified by its Google Cloud organization ID

Example
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)
	}
}
Output:

Example (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.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

func (*CloudControlsPartnerCoreClient) ListWorkloads

ListWorkloads lists customer workloads for a given customer org id

Example
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)
	}
}
Output:

Example (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.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type CloudControlsPartnerMonitoringCallOptions

type CloudControlsPartnerMonitoringCallOptions struct {
	ListViolations []gax.CallOption
	GetViolation   []gax.CallOption
}

CloudControlsPartnerMonitoringCallOptions contains the retry settings for each method of CloudControlsPartnerMonitoringClient.

type 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
}
Output:

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
}
Output:

func (*CloudControlsPartnerMonitoringClient) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*CloudControlsPartnerMonitoringClient) Connection deprecated

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

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
}
Output:

func (*CloudControlsPartnerMonitoringClient) ListViolations

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}

Example
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)
	}
}
Output:

Example (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.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type 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 added in v1.1.0

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*CustomerIterator) Next

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.

type 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 added in v1.1.0

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*ViolationIterator) Next

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.

type 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 added in v1.1.0

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*WorkloadIterator) Next

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL