Class: Google::Apis::EventarcV1::GoogleCloudEventarcV1PipelineDestinationHttpEndpoint

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/eventarc_v1/classes.rb,
lib/google/apis/eventarc_v1/representations.rb,
lib/google/apis/eventarc_v1/representations.rb

Overview

Represents a HTTP endpoint destination.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudEventarcV1PipelineDestinationHttpEndpoint

Returns a new instance of GoogleCloudEventarcV1PipelineDestinationHttpEndpoint.



1129
1130
1131
# File 'lib/google/apis/eventarc_v1/classes.rb', line 1129

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#message_binding_templateString

Optional. The CEL expression used to construct a new HTTP request to be sent to the final destination. The result of the CEL expression must be a map of key/value pairs such that: - If a map named headers exists on the result of the expression, then its key/value pairs are directly mapped to the HTTP request headers. The headers values are constructed from the corresponding value type’s canonical representation. If the headers field doesn’t exist then the resulting HTTP request will be without headers. - If a field named body exists on the result of the expression then its value is directly mapped to the body of the request. If the value of the body field is of type bytes or string then it is used for the HTTP request body as-is, with no conversion. If the body field is of any other type then it is converted to a JSON string. If the body field doesn’t exist then the resulting HTTP request will be without a body. - Any other fields in the resulting expression will be ignored. The CEL expression may access the incoming CloudEvent message in its definition, as follows: - The data field of the incoming CloudEvent message can be accessed using the message.data value. - Each attribute of the incoming CloudEvent message can be accessed using the message. value, where is replaced with the name of the attribute. Headers added to the request by previous filters in the chain can be accessed in the CEL expression using the headers variable. The headers variable defines a map of key/value pairs corresponding to the HTTP headers added by previous mediation steps and not the headers present on the original incoming request. For example, the following CEL expression can be used to construct a Headers-only HTTP request by adding an additional header to the headers added by previous mediations in the Pipeline: `"headers": headers.merge(`"new-header-key": "new-header- value"`)` Additionally, the following CEL extension functions are provided for use in this CEL expression: - toBase64Url: map.toBase64Url() -> string - Converts a CelValue to a base64url encoded string - toJsonString: map. toJsonString() -> string - Converts a CelValue to a JSON string - merge: map1. merge(map2) -> map3 - Merges the passed CEL map with the existing CEL map the function is applied to. - If the same key exists in both maps, if the key's value is type map both maps are merged else the value from the passed map is used. - toMap: list(map).toMap() -> map - Converts a CEL list of CEL maps to a single CEL map - toDestinationPayloadFormat(): message.data. toDestinationPayloadFormat() -> string or bytes - Converts the message data to the destination payload format specified in Pipeline.Destination. output_payload_format - This function is meant to be applied to the message. data field. - If the destination payload format is not set, the function will return the message data unchanged. - toCloudEventJsonWithPayloadFormat: message.toCloudEventJsonWithPayloadFormat() -> map - Converts a message to the corresponding structure of JSON format for CloudEvents - This function applies toDestinationPayloadFormat() to the message data. It also sets the corresponding datacontenttype of the CloudEvent, as indicated by Pipeline. Destination.output_payload_format. If no output_payload_format is set it will use the existing datacontenttype on the CloudEvent if present, else leave datacontenttype absent. - This function expects that the content of the message will adhere to the standard CloudEvent format. If it doesn’t then this function will fail. - The result is a CEL map that corresponds to the JSON representation of the CloudEvent. To convert that data to a JSON string it can be chained with the toJsonString function. If a binding is not specified here, by default the message is treated as a CloudEvent and is mapped to the HTTP request according to the CloudEvent HTTP Protocol Binding Binary Content Mode. The Pipeline converts the data field of the message to the format provided in Pipeline.Destination.output_payload_format and maps it to the body field of the result. It also sets the corresponding Content-Type header to the output_payload_format type. If the Pipeline.Destination.output_payload_format is not set, then the Pipeline will treat the data field of the message as opaque binary data and attach it to the request body as bytes. In this case the Content-type header will be set to the value of the datacontenttype attribute set on the incoming CloudEvent message if present and the application/octet-stream MIME type otherwise. The Pipeline expects that the content of the message will adhere to the standard CloudEvent format. If it doesn’t then the outgoing message request may fail with a persistent error. Corresponds to the JSON property messageBindingTemplate

Returns:

  • (String)


1118
1119
1120
# File 'lib/google/apis/eventarc_v1/classes.rb', line 1118

def message_binding_template
  @message_binding_template
end

#uriString

Required. The URI of the HTTP enpdoint. The value must be a RFC2396 URI string. Examples: http://10.10.10.8:80/route, http://svc.us-central1.p.local:8080/ . Only HTTP and HTTPS protocols are supported. The host can be either a static IP addressable from the VPC specified by the network config, or an internal DNS hostname of the service resolvable via Cloud DNS. Corresponds to the JSON property uri

Returns:

  • (String)


1127
1128
1129
# File 'lib/google/apis/eventarc_v1/classes.rb', line 1127

def uri
  @uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1134
1135
1136
1137
# File 'lib/google/apis/eventarc_v1/classes.rb', line 1134

def update!(**args)
  @message_binding_template = args[:message_binding_template] if args.key?(:message_binding_template)
  @uri = args[:uri] if args.key?(:uri)
end