Skip to content

Commit

Permalink
Merge pull request #218 from inspec/CHEF-7204-MAGIC-MODULE-compute_v1…
Browse files Browse the repository at this point in the history
…-RegionNotificationEndpoint

CHEF-7204-MAGIC-MODULE-compute_v1-RegionNotificationEndpoint - Resource Implementation
  • Loading branch information
sa-progress authored Nov 25, 2024
2 parents 870f793 + c104443 commit 496a1cf
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 0 deletions.
190 changes: 190 additions & 0 deletions mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28268,6 +28268,196 @@ objects:




- !ruby/object:Api::Resource
name: RegionNotificationEndpoint
base_url: 'projects/{{project}}/regions/{{region}}/notificationEndpoints'
self_link: 'projects/{{project}}/regions/{{region}}/notificationEndpoints/{{notificationEndpoint}}'
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation':
api: 'https://cloud.google.com/compute/docs'
async: !ruby/object:Api::OpAsync
operation: !ruby/object:Api::OpAsync::Operation
path: 'name'
base_url: '{op_id}'
wait_ms: 1000
result: !ruby/object:Api::OpAsync::Result
path: 'response'
resource_inside_response: true
status: !ruby/object:Api::OpAsync::Status
path: 'done'
complete: True
allowed:
- True
- False
error: !ruby/object:Api::OpAsync::Error
path: 'error'
message: 'message'
description: |-
Represents a notification endpoint. A notification endpoint resource defines an endpoint to receive notifications when there are status changes detected by the associated health check service. For more information, see Health checks overview.
properties:

- !ruby/object:Api::Type::String
name: 'kind'
description: |
[Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints.
- !ruby/object:Api::Type::String
name: 'id'
description: |
[Output Only] A unique identifier for this resource type. The server generates this identifier.
- !ruby/object:Api::Type::String
name: 'creationTimestamp'
description: |
[Output Only] Creation timestamp in RFC3339 text format.
- !ruby/object:Api::Type::String
name: 'name'
description: |
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
- !ruby/object:Api::Type::String
name: 'description'
description: |
An optional description of this resource. Provide this property when you create the resource.
- !ruby/object:Api::Type::String
name: 'selfLink'
description: |
[Output Only] Server-defined URL for the resource.
- !ruby/object:Api::Type::String
name: 'region'
description: |
[Output Only] URL of the region where the notification endpoint resides. This field applies only to the regional resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
- !ruby/object:Api::Type::NestedObject
name: 'grpcSettings'
description: |
Represents a gRPC setting that describes one gRPC notification endpoint and the retry duration attempting to send notification to this endpoint.
properties:
- !ruby/object:Api::Type::String
name: 'endpoint'
description: |
Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name.
- !ruby/object:Api::Type::Integer
name: 'retryDurationSec'
description: |
How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number.
- !ruby/object:Api::Type::String
name: 'payloadName'
description: |
Optional. If specified, this field is used to populate the "name" field in gRPC requests.
- !ruby/object:Api::Type::String
name: 'authority'
description: |
Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3
- !ruby/object:Api::Type::NestedObject
name: 'resendInterval'
description: |
A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". Range is approximately 10,000 years.
properties:
- !ruby/object:Api::Type::String
name: 'seconds'
description: |
Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
- !ruby/object:Api::Type::Integer
name: 'nanos'
description: |
Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive.




- !ruby/object:Api::Resource
name: RegionNotificationEndpoint
base_url: 'projects/{{project}}/regions/{{region}}/notificationEndpoints'
self_link: 'projects/{{project}}/regions/{{region}}/notificationEndpoints/{{notificationEndpoint}}'
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation':
api: 'https://cloud.google.com/compute/docs'
async: !ruby/object:Api::OpAsync
operation: !ruby/object:Api::OpAsync::Operation
path: 'name'
base_url: '{op_id}'
wait_ms: 1000
result: !ruby/object:Api::OpAsync::Result
path: 'response'
resource_inside_response: true
status: !ruby/object:Api::OpAsync::Status
path: 'done'
complete: True
allowed:
- True
- False
error: !ruby/object:Api::OpAsync::Error
path: 'error'
message: 'message'
description: |-
Represents a notification endpoint. A notification endpoint resource defines an endpoint to receive notifications when there are status changes detected by the associated health check service. For more information, see Health checks overview.
properties:

- !ruby/object:Api::Type::String
name: 'kind'
description: |
[Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints.
- !ruby/object:Api::Type::String
name: 'id'
description: |
[Output Only] A unique identifier for this resource type. The server generates this identifier.
- !ruby/object:Api::Type::String
name: 'creationTimestamp'
description: |
[Output Only] Creation timestamp in RFC3339 text format.
- !ruby/object:Api::Type::String
name: 'name'
description: |
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
- !ruby/object:Api::Type::String
name: 'description'
description: |
An optional description of this resource. Provide this property when you create the resource.
- !ruby/object:Api::Type::String
name: 'selfLink'
description: |
[Output Only] Server-defined URL for the resource.
- !ruby/object:Api::Type::String
name: 'region'
description: |
[Output Only] URL of the region where the notification endpoint resides. This field applies only to the regional resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
- !ruby/object:Api::Type::NestedObject
name: 'grpcSettings'
description: |
Represents a gRPC setting that describes one gRPC notification endpoint and the retry duration attempting to send notification to this endpoint.
properties:
- !ruby/object:Api::Type::String
name: 'endpoint'
description: |
Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name.
- !ruby/object:Api::Type::Integer
name: 'retryDurationSec'
description: |
How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number.
- !ruby/object:Api::Type::String
name: 'payloadName'
description: |
Optional. If specified, this field is used to populate the "name" field in gRPC requests.
- !ruby/object:Api::Type::String
name: 'authority'
description: |
Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3
- !ruby/object:Api::Type::NestedObject
name: 'resendInterval'
description: |
A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". Range is approximately 10,000 years.
properties:
- !ruby/object:Api::Type::String
name: 'seconds'
description: |
Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
- !ruby/object:Api::Type::Integer
name: 'nanos'
description: |
Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive.




- !ruby/object:Api::Resource
name: Reservation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% region_notification_endpoint = grab_attributes(pwd)['region_notification_endpoint'] -%>
describe google_compute_region_notification_endpoint(notificationEndpoint: <%= doc_generation ? "' #{region_notification_endpoint['notificationEndpoint']}'":"region_notification_endpoint['notificationEndpoint']" -%>, project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{region_notification_endpoint['region']}'":"region_notification_endpoint['region']" -%>) do
it { should exist }
its('kind') { should cmp <%= doc_generation ? "'#{region_notification_endpoint['kind']}'" : "region_notification_endpoint['kind']" -%> }
its('id') { should cmp <%= doc_generation ? "'#{region_notification_endpoint['id']}'" : "region_notification_endpoint['id']" -%> }
its('creation_timestamp') { should cmp <%= doc_generation ? "'#{region_notification_endpoint['creation_timestamp']}'" : "region_notification_endpoint['creation_timestamp']" -%> }
its('name') { should cmp <%= doc_generation ? "'#{region_notification_endpoint['name']}'" : "region_notification_endpoint['name']" -%> }
its('description') { should cmp <%= doc_generation ? "'#{region_notification_endpoint['description']}'" : "region_notification_endpoint['description']" -%> }
its('self_link') { should cmp <%= doc_generation ? "'#{region_notification_endpoint['self_link']}'" : "region_notification_endpoint['self_link']" -%> }
its('region') { should cmp <%= doc_generation ? "'#{region_notification_endpoint['region']}'" : "region_notification_endpoint['region']" -%> }

end

describe google_compute_region_notification_endpoint(notificationEndpoint: <%= doc_generation ? "' #{region_notification_endpoint['notificationEndpoint']}'":"region_notification_endpoint['notificationEndpoint']" -%>, project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{region_notification_endpoint['region']}'":"region_notification_endpoint['region']" -%>) do
it { should_not exist }
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gcp_project_id = input(:gcp_project_id, value: '<%= external_attribute(pwd, 'gcp_project_id') -%>', description: 'The GCP project identifier.')

region_notification_endpoint = input('region_notification_endpoint', value: <%= JSON.pretty_generate(grab_attributes(pwd)['region_notification_endpoint']) -%>, description: 'region_notification_endpoint description')
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% region_notification_endpoint = grab_attributes(pwd)['region_notification_endpoint'] -%>
describe google_compute_region_notification_endpoints(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{region_notification_endpoint['region']}'":"region_notification_endpoint['region']" -%>) do
it { should exist }
end
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,16 @@ target_grpc_proxy:
self_link_with_id : "value_selflinkwithid"
url_map : "value_urlmap"
fingerprint : "value_fingerprint"
region_notification_endpoint:
project : "value_project"
public_advertised_prefix : "value_publicadvertisedprefix"
kind : "value_kind"
id : "value_id"
creation_timestamp : "value_creationtimestamp"
name : "value_name"
description : "value_description"
self_link : "value_selflink"
region : "value_region"
public_advertised_prefix:
project : "value_project"
public_advertised_prefix : "value_publicadvertisedprefix"
Expand Down

0 comments on commit 496a1cf

Please sign in to comment.