diff --git a/mmv1/products/apigee/api.yaml b/mmv1/products/apigee/api.yaml index 1c0bfcec7..42c7fd6e7 100644 --- a/mmv1/products/apigee/api.yaml +++ b/mmv1/products/apigee/api.yaml @@ -498,3 +498,123 @@ 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: OrganizationEnvgroup + base_url: '{{parent}}/envgroups' + 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: |- + EnvironmentGroup configuration. An environment group is used to group one or more Apigee environments under a single host name. + properties: + + - !ruby/object:Api::Type::String + name: 'name' + description: | + ID of the environment group. + - !ruby/object:Api::Type::String + name: 'lastModifiedAt' + description: | + Output only. The time at which the environment group was last updated as milliseconds since epoch. + - !ruby/object:Api::Type::Array + name: 'hostnames' + description: | + Required. Host names for this environment group. + item_type: Api::Type::String + - !ruby/object:Api::Type::Enum + name: 'state' + description: | + Output only. State of the environment group. Values other than ACTIVE means the resource is not ready to use. + values: + - :STATE_UNSPECIFIED + - :CREATING + - :ACTIVE + - :DELETING + - :UPDATING + - !ruby/object:Api::Type::String + name: 'createdAt' + description: | + Output only. The time at which the environment group was created as milliseconds since epoch. + + + + + - !ruby/object:Api::Resource + name: OrganizationEnvgroup + base_url: '{{parent}}/envgroups' + 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: |- + EnvironmentGroup configuration. An environment group is used to group one or more Apigee environments under a single host name. + properties: + + - !ruby/object:Api::Type::String + name: 'name' + description: | + ID of the environment group. + - !ruby/object:Api::Type::String + name: 'lastModifiedAt' + description: | + Output only. The time at which the environment group was last updated as milliseconds since epoch. + - !ruby/object:Api::Type::Array + name: 'hostnames' + description: | + Required. Host names for this environment group. + item_type: Api::Type::String + - !ruby/object:Api::Type::Enum + name: 'state' + description: | + Output only. State of the environment group. Values other than ACTIVE means the resource is not ready to use. + values: + - :STATE_UNSPECIFIED + - :CREATING + - :ACTIVE + - :DELETING + - :UPDATING + - !ruby/object:Api::Type::String + name: 'createdAt' + description: | + Output only. The time at which the environment group was created as milliseconds since epoch. + diff --git a/mmv1/products/apigee/inspec.yaml b/mmv1/products/apigee/inspec.yaml new file mode 100644 index 000000000..28cb365e9 --- /dev/null +++ b/mmv1/products/apigee/inspec.yaml @@ -0,0 +1,15 @@ +# 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 diff --git a/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroup.erb b/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroup.erb new file mode 100644 index 000000000..04f6f2526 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroup.erb @@ -0,0 +1,14 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> +<% organization_envgroup = grab_attributes(pwd)['organization_envgroup'] -%> +describe google_apigee_organization_envgroup(name: <%= doc_generation ? "' #{organization_envgroup['name']}'":"organization_envgroup['name']" -%>) do + it { should exist } + its('name') { should cmp <%= doc_generation ? "'#{organization_envgroup['name']}'" : "organization_envgroup['name']" -%> } + its('last_modified_at') { should cmp <%= doc_generation ? "'#{organization_envgroup['last_modified_at']}'" : "organization_envgroup['last_modified_at']" -%> } + its('state') { should cmp <%= doc_generation ? "'#{organization_envgroup['state']}'" : "organization_envgroup['state']" -%> } + its('created_at') { should cmp <%= doc_generation ? "'#{organization_envgroup['created_at']}'" : "organization_envgroup['created_at']" -%> } + +end + +describe google_apigee_organization_envgroup(name: "does_not_exit") do + it { should_not exist } +end \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroup_attributes.erb b/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroup_attributes.erb new file mode 100644 index 000000000..0663d1f90 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroup_attributes.erb @@ -0,0 +1,3 @@ +gcp_project_id = input(:gcp_project_id, value: '<%= external_attribute(pwd, 'gcp_project_id') -%>', description: 'The GCP project identifier.') + + organization_envgroup = input('organization_envgroup', value: <%= JSON.pretty_generate(grab_attributes(pwd)['organization_envgroup']) -%>, description: 'organization_envgroup description') \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroups.erb b/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroups.erb new file mode 100644 index 000000000..5f87fde16 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_apigee_organization_envgroup/google_apigee_organization_envgroups.erb @@ -0,0 +1,5 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> + <% organization_envgroup = grab_attributes(pwd)['organization_envgroup'] -%> + describe google_apigee_organization_envgroups(parent: <%= doc_generation ? "' #{organization_envgroup['parent']}'":"organization_envgroup['parent']" -%>) do + it { should exist } + end \ No newline at end of file diff --git a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml index ee0783a9e..d27043bc7 100644 --- a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml +++ b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml @@ -895,4 +895,10 @@ vpn_gateway: network : "value_network" self_link : "value_selflink" label_fingerprint : "value_labelfingerprint" - stack_type : "value_stacktype" \ No newline at end of file + stack_type : "value_stacktype" +organization_envgroup: + name : "value_name" + parent : "value_parent" + last_modified_at : "value_lastmodifiedat" + state : "value_state" + created_at : "value_createdat" \ No newline at end of file