Skip to content

Commit

Permalink
update url and testcases
Browse files Browse the repository at this point in the history
Signed-off-by: balasubramanian-s <balasubramanian.s@progress.com>
  • Loading branch information
balasubramanian-s committed Jan 11, 2024
1 parent 6fee902 commit 19d811f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
Empty file.
6 changes: 3 additions & 3 deletions docs/resources/google_apigee_organization_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ A `google_apigee_organization_api` is used to test a Google OrganizationApi reso

## Examples
```
describe google_apigee_organization_api(name: ' value_name') do
describe google_apigee_organization_api(parent: ' value_parent', name: ' value_name') do
it { should exist }
its('latest_revision_id') { should cmp 'value_latestrevisionid' }
its('api_proxy_type') { should cmp 'value_apiproxytype' }
its('name') { should cmp 'value_name' }
end
describe google_apigee_organization_api(name: "does_not_exit") do
describe google_apigee_organization_api(parent: ' value_parent', name: "does_not_exit") do
it { should_not exist }
end
```
Expand Down Expand Up @@ -47,7 +47,7 @@ Properties that can be accessed from the `google_apigee_organization_api` resour

* `labels`: User labels applied to this API Proxy.

* `additional_properties`:
* `additional_properties`:

* `name`: Output only. Name of the API proxy.

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_apigee_organization_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ def product_url(_ = nil)
end

def resource_base_url
'{{name}}'
'{{parent}}/apis/{{name}}'
end
end
16 changes: 8 additions & 8 deletions libraries/google_apigee_organization_apis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ApigeeOrganizationApis < GcpResourceBase
def initialize(params = {})
super(params.merge({ use_http_transport: true }))
@params = params
@table = fetch_wrapped_resource('organizationApis')
@table = fetch_wrapped_resource('proxies')
end

def fetch_wrapped_resource(wrap_path)
Expand Down Expand Up @@ -69,13 +69,13 @@ def transform(key, value)

def transformers
{
'revision' => ->(obj) { return :revision, obj['revision'] },
'latestRevisionId' => ->(obj) { return :latest_revision_id, obj['latestRevisionId'] },
'metaData' => ->(obj) { return :meta_data, GoogleInSpec::Apigee::Property::OrganizationApiMetaData.new(obj['metaData'], to_s) },
'apiProxyType' => ->(obj) { return :api_proxy_type, obj['apiProxyType'] },
'readOnly' => ->(obj) { return :read_only, obj['readOnly'] },
'labels' => ->(obj) { return :labels, GoogleInSpec::Apigee::Property::OrganizationApiLabels.new(obj['labels'], to_s) },
'name' => ->(obj) { return :name, obj['name'] },
'revision' => ->(obj) { [:revision, obj['revision']] },
'latestRevisionId' => ->(obj) { [:latest_revision_id, obj['latestRevisionId']] },
'metaData' => ->(obj) { [:meta_data, GoogleInSpec::Apigee::Property::OrganizationApiMetaData.new(obj['metaData'], to_s)] },
'apiProxyType' => ->(obj) { [:api_proxy_type, obj['apiProxyType']] },
'readOnly' => ->(obj) { [:read_only, obj['readOnly']] },
'labels' => ->(obj) { [:labels, GoogleInSpec::Apigee::Property::OrganizationApiLabels.new(obj['labels'], to_s)] },
'name' => ->(obj) { [:name, obj['name']] },
}
end

Expand Down
5 changes: 5 additions & 0 deletions test/integration/configuration/mm-attributes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -621,3 +621,8 @@ vpn_gateway:
self_link : "value_selflink"
label_fingerprint : "value_labelfingerprint"
stack_type : "IPV4_ONLY"

apigee_organization_apis:
name : "firstproxy",
parent : "organizations/ppradhan",
api_proxy_type : "PROGRAMMABLE"
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@
gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.')

organization_api = input('organization_api', value: {
"name": "value_name",
"parent": "value_parent",
"name": "firstproxy",
"parent": "organizations/ppradhan",
"latest_revision_id": "value_latestrevisionid",
"api_proxy_type": "value_apiproxytype"
"api_proxy_type": "PROGRAMMABLE"
}, description: 'organization_api description')
control 'google_apigee_organization_api-1.0' do
impact 1.0
title 'google_apigee_organization_api resource test'

describe google_apigee_organization_api(name: organization_api['name']) do
describe google_apigee_organization_api(parent: organization_api['parent'],name: organization_api['name']) do
it { should exist }
its('latest_revision_id') { should cmp organization_api['latest_revision_id'] }
its('api_proxy_type') { should cmp organization_api['api_proxy_type'] }
its('name') { should cmp organization_api['name'] }

end

describe google_apigee_organization_api(name: "does_not_exit") do
describe google_apigee_organization_api(parent: organization_api['parent'],name: "does_not_exit") do
it { should_not exist }
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.')

organization_api = input('organization_api', value: {
"name": "value_name",
"parent": "value_parent",
"name": "firstproxy",
"parent": "organizations/ppradhan",
"latest_revision_id": "value_latestrevisionid",
"api_proxy_type": "value_apiproxytype"
"api_proxy_type": "PROGRAMMABLE"
}, description: 'organization_api description')
control 'google_apigee_organization_apis-1.0' do
impact 1.0
title 'google_apigee_organization_apis resource test'

describe google_apigee_organization_apis(parent: organization_api['parent']) do
describe google_apigee_organization_apis(parent: organization_api['parent']) do
it { should exist }
end
end

0 comments on commit 19d811f

Please sign in to comment.