Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHEF-7361-MAGIC-MODULE-apigee-Organizations__apis__revision - Resource Implementation #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions mmv1/products/apigee/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,93 @@ objects:
'Creating an environment':
'https://cloud.google.com/apigee/docs/api-platform/get-started/create-environment'
api: 'https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.endpointAttachments/create'



- !ruby/object:Api::Resource
name: OrganizationApiRevision
self_link: '{{name}}'
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation':
api: 'https://cloud.google.com/apigee/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: |-
Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
properties:

- !ruby/object:Api::Type::Array
name: 'extensions'
description: |
Application specific response metadata. Must be set in the first response for streaming APIs.
item_type: Api::Type::String
- !ruby/object:Api::Type::String
name: 'contentType'
description: |
The HTTP Content-Type header value specifying the content type of the body.
- !ruby/object:Api::Type::String
name: 'data'
description: |
The HTTP request/response body as raw binary.




- !ruby/object:Api::Resource
name: OrganizationApiRevision
self_link: '{{name}}'
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation':
api: 'https://cloud.google.com/apigee/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: |-
Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
properties:

- !ruby/object:Api::Type::Array
name: 'extensions'
description: |
Application specific response metadata. Must be set in the first response for streaming APIs.
item_type: Api::Type::String
- !ruby/object:Api::Type::String
name: 'contentType'
description: |
The HTTP Content-Type header value specifying the content type of the body.
- !ruby/object:Api::Type::String
name: 'data'
description: |
The HTTP request/response body as raw binary.

20 changes: 20 additions & 0 deletions mmv1/products/apigee/inspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2017 Google Inc.
# 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.

--- !ruby/object:Provider::Inspec::Config
overrides: !ruby/object:Overrides::ResourceOverrides
OrganizationApiRevision: !ruby/object:Overrides::Inspec::ResourceOverride
singular_only: true

singular_only: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% organization_api_revision = grab_attributes(pwd)['organization_api_revision'] -%>
describe google_apigee_organization_api_revision(clusterName: <%= doc_generation ? "' #{organization_api_revision['clusterName']}'":"organization_api_revision['clusterName']" -%>, projectId: <%= doc_generation ? "' #{organization_api_revision['projectId']}'":"organization_api_revision['projectId']" -%>, region: <%= doc_generation ? "' #{organization_api_revision['region']}'":"organization_api_revision['region']" -%>) do
it { should exist }

end

describe google_apigee_organization_api_revision(clusterName: <%= doc_generation ? "' #{organization_api_revision['clusterName']}'":"organization_api_revision['clusterName']" -%>, projectId: <%= doc_generation ? "' #{organization_api_revision['projectId']}'":"organization_api_revision['projectId']" -%>, region: <%= doc_generation ? "' #{organization_api_revision['region']}'":"organization_api_revision['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.')

organization_api_revision = input('organization_api_revision', value: <%= JSON.pretty_generate(grab_attributes(pwd)['organization_api_revision']) -%>, description: 'organization_api_revision 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)}" -%>
<% organization_api_revision = grab_attributes(pwd)['organization_api_revision'] -%>
describe google_apigee_organization_api_revisions(projectId: <%= doc_generation ? "' #{organization_api_revision['projectId']}'":"organization_api_revision['projectId']" -%>, region: <%= doc_generation ? "' #{organization_api_revision['region']}'":"organization_api_revision['region']" -%>) do
it { should exist }
end
Original file line number Diff line number Diff line change
Expand Up @@ -880,3 +880,10 @@ tensorboard_experiment_run_time_series_resource:
update_time : "value_updatetime"
create_time : "value_createtime"
value_type : "value_valuetype"

organization_api_revision:
cluster_name : "value_clustername"
project_id : "value_projectid"
region : "value_region"
organization_api_revision:
name : "value_name"