Skip to content

Commit dfff5d9

Browse files
authored
Merge pull request #140 from inspec/CHEF-7356-MAGIC-MODULE-apigee-Organizations__envgroup
CHEF-7356-MAGIC-MODULE-apigee-Organizations__envgroup - Resource Implementation
2 parents 1478631 + 32dc8ed commit dfff5d9

5 files changed

Lines changed: 156 additions & 5 deletions

File tree

mmv1/products/apigee/api.yaml

Lines changed: 125 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ objects:
500500
api: 'https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.endpointAttachments/create'
501501

502502

503-
503+
504504
- !ruby/object:Api::Resource
505505
name: Organization
506506
base_url: '{{parent}}'
@@ -529,7 +529,7 @@ objects:
529529
description: |-
530530
No description
531531
properties:
532-
532+
533533
- !ruby/object:Api::Type::String
534534
name: 'apiConsumerDataEncryptionKeyName'
535535
description: |
@@ -768,10 +768,10 @@ objects:
768768
- :SUBSCRIPTION
769769
- :EVALUATION
770770
- :PAYG
771-
772771

773772

774-
773+
774+
775775
- !ruby/object:Api::Resource
776776
name: Organization
777777
base_url: '{{parent}}'
@@ -800,7 +800,7 @@ objects:
800800
description: |-
801801
No description
802802
properties:
803-
803+
804804
- !ruby/object:Api::Type::String
805805
name: 'apiConsumerDataEncryptionKeyName'
806806
description: |
@@ -1039,4 +1039,124 @@ objects:
10391039
- :SUBSCRIPTION
10401040
- :EVALUATION
10411041
- :PAYG
1042+
1043+
1044+
1045+
1046+
- !ruby/object:Api::Resource
1047+
name: OrganizationEnvgroup
1048+
base_url: '{{parent}}/envgroups'
1049+
self_link: '{{name}}'
1050+
references: !ruby/object:Api::Resource::ReferenceLinks
1051+
guides:
1052+
'Official Documentation':
1053+
api: 'https://cloud.google.com/apigee/docs'
1054+
async: !ruby/object:Api::OpAsync
1055+
operation: !ruby/object:Api::OpAsync::Operation
1056+
path: 'name'
1057+
base_url: '{op_id}'
1058+
wait_ms: 1000
1059+
result: !ruby/object:Api::OpAsync::Result
1060+
path: 'response'
1061+
resource_inside_response: true
1062+
status: !ruby/object:Api::OpAsync::Status
1063+
path: 'done'
1064+
complete: True
1065+
allowed:
1066+
- True
1067+
- False
1068+
error: !ruby/object:Api::OpAsync::Error
1069+
path: 'error'
1070+
message: 'message'
1071+
description: |-
1072+
EnvironmentGroup configuration. An environment group is used to group one or more Apigee environments under a single host name.
1073+
properties:
1074+
1075+
- !ruby/object:Api::Type::String
1076+
name: 'name'
1077+
description: |
1078+
ID of the environment group.
1079+
- !ruby/object:Api::Type::String
1080+
name: 'lastModifiedAt'
1081+
description: |
1082+
Output only. The time at which the environment group was last updated as milliseconds since epoch.
1083+
- !ruby/object:Api::Type::Array
1084+
name: 'hostnames'
1085+
description: |
1086+
Required. Host names for this environment group.
1087+
item_type: Api::Type::String
1088+
- !ruby/object:Api::Type::Enum
1089+
name: 'state'
1090+
description: |
1091+
Output only. State of the environment group. Values other than ACTIVE means the resource is not ready to use.
1092+
values:
1093+
- :STATE_UNSPECIFIED
1094+
- :CREATING
1095+
- :ACTIVE
1096+
- :DELETING
1097+
- :UPDATING
1098+
- !ruby/object:Api::Type::String
1099+
name: 'createdAt'
1100+
description: |
1101+
Output only. The time at which the environment group was created as milliseconds since epoch.
1102+
1103+
1104+
1105+
1106+
- !ruby/object:Api::Resource
1107+
name: OrganizationEnvgroup
1108+
base_url: '{{parent}}/envgroups'
1109+
self_link: '{{name}}'
1110+
references: !ruby/object:Api::Resource::ReferenceLinks
1111+
guides:
1112+
'Official Documentation':
1113+
api: 'https://cloud.google.com/apigee/docs'
1114+
async: !ruby/object:Api::OpAsync
1115+
operation: !ruby/object:Api::OpAsync::Operation
1116+
path: 'name'
1117+
base_url: '{op_id}'
1118+
wait_ms: 1000
1119+
result: !ruby/object:Api::OpAsync::Result
1120+
path: 'response'
1121+
resource_inside_response: true
1122+
status: !ruby/object:Api::OpAsync::Status
1123+
path: 'done'
1124+
complete: True
1125+
allowed:
1126+
- True
1127+
- False
1128+
error: !ruby/object:Api::OpAsync::Error
1129+
path: 'error'
1130+
message: 'message'
1131+
description: |-
1132+
EnvironmentGroup configuration. An environment group is used to group one or more Apigee environments under a single host name.
1133+
properties:
1134+
1135+
- !ruby/object:Api::Type::String
1136+
name: 'name'
1137+
description: |
1138+
ID of the environment group.
1139+
- !ruby/object:Api::Type::String
1140+
name: 'lastModifiedAt'
1141+
description: |
1142+
Output only. The time at which the environment group was last updated as milliseconds since epoch.
1143+
- !ruby/object:Api::Type::Array
1144+
name: 'hostnames'
1145+
description: |
1146+
Required. Host names for this environment group.
1147+
item_type: Api::Type::String
1148+
- !ruby/object:Api::Type::Enum
1149+
name: 'state'
1150+
description: |
1151+
Output only. State of the environment group. Values other than ACTIVE means the resource is not ready to use.
1152+
values:
1153+
- :STATE_UNSPECIFIED
1154+
- :CREATING
1155+
- :ACTIVE
1156+
- :DELETING
1157+
- :UPDATING
1158+
- !ruby/object:Api::Type::String
1159+
name: 'createdAt'
1160+
description: |
1161+
Output only. The time at which the environment group was created as milliseconds since epoch.
10421162
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
2+
<% organization_envgroup = grab_attributes(pwd)['organization_envgroup'] -%>
3+
describe google_apigee_organization_envgroup(name: <%= doc_generation ? "' #{organization_envgroup['name']}'":"organization_envgroup['name']" -%>) do
4+
it { should exist }
5+
its('name') { should cmp <%= doc_generation ? "'#{organization_envgroup['name']}'" : "organization_envgroup['name']" -%> }
6+
its('last_modified_at') { should cmp <%= doc_generation ? "'#{organization_envgroup['last_modified_at']}'" : "organization_envgroup['last_modified_at']" -%> }
7+
its('state') { should cmp <%= doc_generation ? "'#{organization_envgroup['state']}'" : "organization_envgroup['state']" -%> }
8+
its('created_at') { should cmp <%= doc_generation ? "'#{organization_envgroup['created_at']}'" : "organization_envgroup['created_at']" -%> }
9+
10+
end
11+
12+
describe google_apigee_organization_envgroup(name: "does_not_exit") do
13+
it { should_not exist }
14+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
gcp_project_id = input(:gcp_project_id, value: '<%= external_attribute(pwd, 'gcp_project_id') -%>', description: 'The GCP project identifier.')
2+
3+
organization_envgroup = input('organization_envgroup', value: <%= JSON.pretty_generate(grab_attributes(pwd)['organization_envgroup']) -%>, description: 'organization_envgroup description')
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
2+
<% organization_envgroup = grab_attributes(pwd)['organization_envgroup'] -%>
3+
describe google_apigee_organization_envgroups(parent: <%= doc_generation ? "' #{organization_envgroup['parent']}'":"organization_envgroup['parent']" -%>) do
4+
it { should exist }
5+
end

mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,14 @@ vpn_gateway:
902902
self_link : "value_selflink"
903903
label_fingerprint : "value_labelfingerprint"
904904
stack_type : "value_stacktype"
905+
906+
organization_envgroup:
907+
name : "value_name"
908+
parent : "value_parent"
909+
last_modified_at : "value_lastmodifiedat"
910+
state : "value_state"
911+
created_at : "value_createdat"
912+
905913
organization:
906914
name : "value_name"
907915
parent : "value_parent"
@@ -926,6 +934,7 @@ organization:
926934
apigee_project_id : "value_apigeeprojectid"
927935
expires_at : "value_expiresat"
928936
billing_type : "value_billingtype"
937+
929938
project_location_environment:
930939
name : "value_name"
931940
parent : "value_parent"

0 commit comments

Comments
 (0)