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-7356-MAGIC-MODULE-apigee-Organizations__envgroup - Resource Implementation #140

Merged
Merged
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
130 changes: 125 additions & 5 deletions mmv1/products/apigee/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ objects:
api: 'https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.endpointAttachments/create'



- !ruby/object:Api::Resource
name: Organization
base_url: '{{parent}}'
Expand Down Expand Up @@ -529,7 +529,7 @@ objects:
description: |-
No description
properties:

- !ruby/object:Api::Type::String
name: 'apiConsumerDataEncryptionKeyName'
description: |
Expand Down Expand Up @@ -768,10 +768,10 @@ objects:
- :SUBSCRIPTION
- :EVALUATION
- :PAYG






- !ruby/object:Api::Resource
name: Organization
base_url: '{{parent}}'
Expand Down Expand Up @@ -800,7 +800,7 @@ objects:
description: |-
No description
properties:

- !ruby/object:Api::Type::String
name: 'apiConsumerDataEncryptionKeyName'
description: |
Expand Down Expand Up @@ -1039,4 +1039,124 @@ objects:
- :SUBSCRIPTION
- :EVALUATION
- :PAYG




- !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.

Original file line number Diff line number Diff line change
@@ -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
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_envgroup = input('organization_envgroup', value: <%= JSON.pretty_generate(grab_attributes(pwd)['organization_envgroup']) -%>, description: 'organization_envgroup 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_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
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,14 @@ vpn_gateway:
self_link : "value_selflink"
label_fingerprint : "value_labelfingerprint"
stack_type : "value_stacktype"

organization_envgroup:
name : "value_name"
parent : "value_parent"
last_modified_at : "value_lastmodifiedat"
state : "value_state"
created_at : "value_createdat"

organization:
name : "value_name"
parent : "value_parent"
Expand All @@ -926,6 +934,7 @@ organization:
apigee_project_id : "value_apigeeprojectid"
expires_at : "value_expiresat"
billing_type : "value_billingtype"

project_location_environment:
name : "value_name"
parent : "value_parent"
Expand Down
Loading