alpha

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2022 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package alpha defines operations in the declarative SDK.

Copyright 2022 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const TriggerMaxPage = -1

Variables

View Source
var YAML_trigger = []byte("info:\n  title: Eventarc/Trigger\n  description: The Eventarc Trigger resource\n  x-dcl-struct-name: Trigger\n  x-dcl-has-iam: false\npaths:\n  get:\n    description: The function used to get information about a Trigger\n    parameters:\n    - name: Trigger\n      required: true\n      description: A full instance of a Trigger\n  apply:\n    description: The function used to apply information about a Trigger\n    parameters:\n    - name: Trigger\n      required: true\n      description: A full instance of a Trigger\n  delete:\n    description: The function used to delete a Trigger\n    parameters:\n    - name: Trigger\n      required: true\n      description: A full instance of a Trigger\n  deleteAll:\n    description: The function used to delete all Trigger\n    parameters:\n    - name: project\n      required: true\n      schema:\n        type: string\n    - name: location\n      required: true\n      schema:\n        type: string\n  list:\n    description: The function used to list information about many Trigger\n    parameters:\n    - name: project\n      required: true\n      schema:\n        type: string\n    - name: location\n      required: true\n      schema:\n        type: string\ncomponents:\n  schemas:\n    Trigger:\n      title: Trigger\n      x-dcl-id: projects/{{project}}/locations/{{location}}/triggers/{{name}}\n      x-dcl-parent-container: project\n      x-dcl-labels: labels\n      x-dcl-has-iam: false\n      type: object\n      required:\n      - name\n      - matchingCriteria\n      - destination\n      - project\n      - location\n      properties:\n        createTime:\n          type: string\n          format: date-time\n          x-dcl-go-name: CreateTime\n          readOnly: true\n          description: Output only. The creation time.\n          x-kubernetes-immutable: true\n        destination:\n          type: object\n          x-dcl-go-name: Destination\n          x-dcl-go-type: TriggerDestination\n          description: Required. Destination specifies where the events should be\n            sent to.\n          properties:\n            cloudFunction:\n              type: string\n              x-dcl-go-name: CloudFunction\n              description: '[WARNING] Configuring a Cloud Function in Trigger is not\n                supported as of today. The Cloud Function resource name. Format: projects/{project}/locations/{location}/functions/{function}'\n              x-dcl-conflicts:\n              - cloudRunService\n              - gke\n              - workflow\n              x-dcl-references:\n              - resource: Cloudfunctions/Function\n                field: name\n            cloudRunService:\n              type: object\n              x-dcl-go-name: CloudRunService\n              x-dcl-go-type: TriggerDestinationCloudRunService\n              description: Cloud Run fully-managed service that receives the events.\n                The service should be running in the same project of the trigger.\n              x-dcl-conflicts:\n              - cloudFunction\n              - gke\n              - workflow\n              required:\n              - service\n              - region\n              properties:\n                path:\n                  type: string\n                  x-dcl-go-name: Path\n                  description: 'Optional. The relative path on the Cloud Run service\n                    the events should be sent to. The value must conform to the definition\n                    of URI path segment (section 3.3 of RFC2396). Examples: \"/route\",\n                    \"route\", \"route/subroute\".'\n                region:\n                  type: string\n                  x-dcl-go-name: Region\n                  description: Required. The region the Cloud Run service is deployed\n                    in.\n                service:\n                  type: string\n                  x-dcl-go-name: Service\n                  description: Required. The name of the Cloud Run service being addressed.\n                    See https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services.\n                    Only services located in the same project of the trigger object\n                    can be addressed.\n                  x-dcl-references:\n                  - resource: Run/Service\n                    field: name\n            gke:\n              type: object\n              x-dcl-go-name: Gke\n              x-dcl-go-type: TriggerDestinationGke\n              description: A GKE service capable of receiving events. The service\n                should be running in the same project as the trigger.\n              x-dcl-conflicts:\n              - cloudRunService\n              - cloudFunction\n              - workflow\n              required:\n              - cluster\n              - location\n              - namespace\n              - service\n              properties:\n                cluster:\n                  type: string\n                  x-dcl-go-name: Cluster\n                  description: Required. The name of the cluster the GKE service is\n                    running in. The cluster must be running in the same project as\n                    the trigger being created.\n                  x-dcl-references:\n                  - resource: Container/Cluster\n                    field: selfLink\n                location:\n                  type: string\n                  x-dcl-go-name: Location\n                  description: Required. The name of the Google Compute Engine in\n                    which the cluster resides, which can either be compute zone (for\n                    example, us-central1-a) for the zonal clusters or region (for\n                    example, us-central1) for regional clusters.\n                namespace:\n                  type: string\n                  x-dcl-go-name: Namespace\n                  description: Required. The namespace the GKE service is running\n                    in.\n                path:\n                  type: string\n                  x-dcl-go-name: Path\n                  description: 'Optional. The relative path on the GKE service the\n                    events should be sent to. The value must conform to the definition\n                    of a URI path segment (section 3.3 of RFC2396). Examples: \"/route\",\n                    \"route\", \"route/subroute\".'\n                service:\n                  type: string\n                  x-dcl-go-name: Service\n                  description: Required. Name of the GKE service.\n            workflow:\n              type: string\n              x-dcl-go-name: Workflow\n              description: 'The resource name of the Workflow whose Executions are\n                triggered by the events. The Workflow resource should be deployed\n                in the same project as the trigger. Format: `projects/{project}/locations/{location}/workflows/{workflow}`'\n              x-dcl-conflicts:\n              - cloudRunService\n              - cloudFunction\n              - gke\n              x-dcl-references:\n              - resource: Workflows/Workflow\n                field: name\n        etag:\n          type: string\n          x-dcl-go-name: Etag\n          readOnly: true\n          description: Output only. This checksum is computed by the server based\n            on the value of other fields, and may be sent only on create requests\n            to ensure the client has an up-to-date value before proceeding.\n          x-kubernetes-immutable: true\n        labels:\n          type: object\n          additionalProperties:\n            type: string\n          x-dcl-go-name: Labels\n          description: Optional. User labels attached to the triggers that can be\n            used to group resources.\n        location:\n          type: string\n          x-dcl-go-name: Location\n          description: The location for the resource\n          x-kubernetes-immutable: true\n        matchingCriteria:\n          type: array\n          x-dcl-go-name: MatchingCriteria\n          description: Required. null The list of filters that applies to event attributes.\n            Only events that match all the provided filters will be sent to the destination.\n          x-dcl-send-empty: true\n          x-dcl-list-type: set\n          items:\n            type: object\n            x-dcl-go-type: TriggerMatchingCriteria\n            required:\n            - attribute\n            - value\n            properties:\n              attribute:\n                type: string\n                x-dcl-go-name: Attribute\n                description: Required. The name of a CloudEvents attribute. Currently,\n                  only a subset of attributes are supported for filtering. All triggers\n                  MUST provide a filter for the 'type' attribute.\n              operator:\n                type: string\n                x-dcl-go-name: Operator\n                description: Optional. The operator used for matching the events with\n                  the value of the filter. If not specified, only events that have\n                  an exact key-value pair specified in the filter are matched. The\n                  only allowed value is `match-path-pattern`.\n              value:\n                type: string\n                x-dcl-go-name: Value\n                description: Required. The value for the attribute.\n        name:\n          type: string\n          x-dcl-go-name: Name\n          description: Required. The resource name of the trigger. Must be unique\n            within the location on the project.\n          x-kubernetes-immutable: true\n        project:\n          type: string\n          x-dcl-go-name: Project\n          description: The project for the resource\n          x-kubernetes-immutable: true\n          x-dcl-references:\n          - resource: Cloudresourcemanager/Project\n            field: name\n            parent: true\n        serviceAccount:\n          type: string\n          x-dcl-go-name: ServiceAccount\n          description: Optional. The IAM service account email associated with the\n            trigger. The service account represents the identity of the trigger. The\n            principal who calls this API must have `iam.serviceAccounts.actAs` permission\n            in the service account. See https://cloud.google.com/iam/docs/understanding-service-accounts#sa_common\n            for more information. For Cloud Run destinations, this service account\n            is used to generate identity tokens when invoking the service. See https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account\n            for information on how to invoke authenticated Cloud Run services. In\n            order to create Audit Log triggers, the service account should also have\n            `roles/eventarc.eventReceiver` IAM role.\n          x-dcl-references:\n          - resource: Iam/ServiceAccount\n            field: email\n        transport:\n          type: object\n          x-dcl-go-name: Transport\n          x-dcl-go-type: TriggerTransport\n          description: Optional. In order to deliver messages, Eventarc may use other\n            GCP products as transport intermediary. This field contains a reference\n            to that transport intermediary. This information can be used for debugging\n            purposes.\n          x-kubernetes-immutable: true\n          x-dcl-server-default: true\n          properties:\n            pubsub:\n              type: object\n              x-dcl-go-name: Pubsub\n              x-dcl-go-type: TriggerTransportPubsub\n              description: The Pub/Sub topic and subscription used by Eventarc as\n                delivery intermediary.\n              x-kubernetes-immutable: true\n              properties:\n                subscription:\n                  type: string\n                  x-dcl-go-name: Subscription\n                  readOnly: true\n                  description: 'Output only. The name of the Pub/Sub subscription\n                    created and managed by Eventarc system as a transport for the\n                    event delivery. Format: `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`.'\n                  x-kubernetes-immutable: true\n                  x-dcl-references:\n                  - resource: Pubsub/Subscription\n                    field: name\n                topic:\n                  type: string\n                  x-dcl-go-name: Topic\n                  description: 'Optional. The name of the Pub/Sub topic created and\n                    managed by Eventarc system as a transport for the event delivery.\n                    Format: `projects/{PROJECT_ID}/topics/{TOPIC_NAME}. You may set\n                    an existing topic for triggers of the type google.cloud.pubsub.topic.v1.messagePublished`\n                    only. The topic you provide here will not be deleted by Eventarc\n                    at trigger deletion.'\n                  x-kubernetes-immutable: true\n                  x-dcl-references:\n                  - resource: Pubsub/Topic\n                    field: name\n        uid:\n          type: string\n          x-dcl-go-name: Uid\n          readOnly: true\n          description: Output only. Server assigned unique identifier for the trigger.\n            The value is a UUID4 string and guaranteed to remain unchanged until the\n            resource is deleted.\n          x-kubernetes-immutable: true\n        updateTime:\n          type: string\n          format: date-time\n          x-dcl-go-name: UpdateTime\n          readOnly: true\n          description: Output only. The last-modified time.\n          x-kubernetes-immutable: true\n")

blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/eventarc/alpha/trigger.yaml

Functions

This section is empty.

Types

type Client

type Client struct {
	Config *dcl.Config
}

The Client is the base struct of all operations. This will receive the Get, Delete, List, and Apply operations on all resources.

func NewClient

func NewClient(c *dcl.Config) *Client

NewClient creates a client that retries all operations a few times each.

func (*Client) ApplyTrigger

func (c *Client) ApplyTrigger(ctx context.Context, rawDesired *Trigger, opts ...dcl.ApplyOption) (*Trigger, error)

func (*Client) DeleteAllTrigger

func (c *Client) DeleteAllTrigger(ctx context.Context, project, location string, filter func(*Trigger) bool) error

DeleteAllTrigger deletes all resources that the filter functions returns true on.

func (*Client) DeleteTrigger

func (c *Client) DeleteTrigger(ctx context.Context, r *Trigger) error

func (*Client) GetTrigger

func (c *Client) GetTrigger(ctx context.Context, r *Trigger) (*Trigger, error)

func (*Client) ListTrigger

func (c *Client) ListTrigger(ctx context.Context, project, location string) (*TriggerList, error)

func (*Client) ListTriggerWithMaxResults

func (c *Client) ListTriggerWithMaxResults(ctx context.Context, project, location string, pageSize int32) (*TriggerList, error)

type Trigger

type Trigger struct {
	Name             *string                   `json:"name"`
	Uid              *string                   `json:"uid"`
	CreateTime       *string                   `json:"createTime"`
	UpdateTime       *string                   `json:"updateTime"`
	MatchingCriteria []TriggerMatchingCriteria `json:"matchingCriteria"`
	ServiceAccount   *string                   `json:"serviceAccount"`
	Destination      *TriggerDestination       `json:"destination"`
	Transport        *TriggerTransport         `json:"transport"`
	Labels           map[string]string         `json:"labels"`
	Etag             *string                   `json:"etag"`
	Project          *string                   `json:"project"`
	Location         *string                   `json:"location"`
}

func (*Trigger) Describe

func (r *Trigger) Describe() dcl.ServiceTypeVersion

Describe returns a simple description of this resource to ensure that automated tools can identify it.

func (*Trigger) ID

func (r *Trigger) ID() (string, error)

func (*Trigger) String

func (r *Trigger) String() string

type TriggerDestination

type TriggerDestination struct {
	CloudRunService *TriggerDestinationCloudRunService `json:"cloudRunService"`
	CloudFunction   *string                            `json:"cloudFunction"`
	Gke             *TriggerDestinationGke             `json:"gke"`
	Workflow        *string                            `json:"workflow"`
	// contains filtered or unexported fields
}
var EmptyTriggerDestination *TriggerDestination = &TriggerDestination{empty: true}

This object is used to assert a desired state where this TriggerDestination is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*TriggerDestination) Empty

func (r *TriggerDestination) Empty() bool

func (*TriggerDestination) HashCode

func (r *TriggerDestination) HashCode() string

func (*TriggerDestination) String

func (r *TriggerDestination) String() string

func (*TriggerDestination) UnmarshalJSON

func (r *TriggerDestination) UnmarshalJSON(data []byte) error

type TriggerDestinationCloudRunService

type TriggerDestinationCloudRunService struct {
	Service *string `json:"service"`
	Path    *string `json:"path"`
	Region  *string `json:"region"`
	// contains filtered or unexported fields
}
var EmptyTriggerDestinationCloudRunService *TriggerDestinationCloudRunService = &TriggerDestinationCloudRunService{empty: true}

This object is used to assert a desired state where this TriggerDestinationCloudRunService is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*TriggerDestinationCloudRunService) Empty

func (*TriggerDestinationCloudRunService) HashCode

func (*TriggerDestinationCloudRunService) String

func (*TriggerDestinationCloudRunService) UnmarshalJSON

func (r *TriggerDestinationCloudRunService) UnmarshalJSON(data []byte) error

type TriggerDestinationGke added in v1.1.0

type TriggerDestinationGke struct {
	Cluster   *string `json:"cluster"`
	Location  *string `json:"location"`
	Namespace *string `json:"namespace"`
	Service   *string `json:"service"`
	Path      *string `json:"path"`
	// contains filtered or unexported fields
}
var EmptyTriggerDestinationGke *TriggerDestinationGke = &TriggerDestinationGke{empty: true}

This object is used to assert a desired state where this TriggerDestinationGke is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*TriggerDestinationGke) Empty added in v1.1.0

func (r *TriggerDestinationGke) Empty() bool

func (*TriggerDestinationGke) HashCode added in v1.1.0

func (r *TriggerDestinationGke) HashCode() string

func (*TriggerDestinationGke) String added in v1.1.0

func (r *TriggerDestinationGke) String() string

func (*TriggerDestinationGke) UnmarshalJSON added in v1.1.0

func (r *TriggerDestinationGke) UnmarshalJSON(data []byte) error

type TriggerList

type TriggerList struct {
	Items []*Trigger
	// contains filtered or unexported fields
}

func (*TriggerList) HasNext

func (l *TriggerList) HasNext() bool

func (*TriggerList) Next

func (l *TriggerList) Next(ctx context.Context, c *Client) error

type TriggerMatchingCriteria

type TriggerMatchingCriteria struct {
	Attribute *string `json:"attribute"`
	Value     *string `json:"value"`
	Operator  *string `json:"operator"`
	// contains filtered or unexported fields
}
var EmptyTriggerMatchingCriteria *TriggerMatchingCriteria = &TriggerMatchingCriteria{empty: true}

This object is used to assert a desired state where this TriggerMatchingCriteria is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*TriggerMatchingCriteria) Empty

func (r *TriggerMatchingCriteria) Empty() bool

func (*TriggerMatchingCriteria) HashCode

func (r *TriggerMatchingCriteria) HashCode() string

func (*TriggerMatchingCriteria) String

func (r *TriggerMatchingCriteria) String() string

func (*TriggerMatchingCriteria) UnmarshalJSON

func (r *TriggerMatchingCriteria) UnmarshalJSON(data []byte) error

type TriggerTransport

type TriggerTransport struct {
	Pubsub *TriggerTransportPubsub `json:"pubsub"`
	// contains filtered or unexported fields
}
var EmptyTriggerTransport *TriggerTransport = &TriggerTransport{empty: true}

This object is used to assert a desired state where this TriggerTransport is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*TriggerTransport) Empty

func (r *TriggerTransport) Empty() bool

func (*TriggerTransport) HashCode

func (r *TriggerTransport) HashCode() string

func (*TriggerTransport) String

func (r *TriggerTransport) String() string

func (*TriggerTransport) UnmarshalJSON

func (r *TriggerTransport) UnmarshalJSON(data []byte) error

type TriggerTransportPubsub

type TriggerTransportPubsub struct {
	Topic        *string `json:"topic"`
	Subscription *string `json:"subscription"`
	// contains filtered or unexported fields
}
var EmptyTriggerTransportPubsub *TriggerTransportPubsub = &TriggerTransportPubsub{empty: true}

This object is used to assert a desired state where this TriggerTransportPubsub is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*TriggerTransportPubsub) Empty

func (r *TriggerTransportPubsub) Empty() bool

func (*TriggerTransportPubsub) HashCode

func (r *TriggerTransportPubsub) HashCode() string

func (*TriggerTransportPubsub) String

func (r *TriggerTransportPubsub) String() string

func (*TriggerTransportPubsub) UnmarshalJSON

func (r *TriggerTransportPubsub) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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