examples showing an improper auth value (#87)

<!-- This change is generated by MagicModules. -->
/cc @rambleraptor
This commit is contained in:
The Magician 2018-09-07 14:15:36 -07:00 committed by Alex Stephen
commit 0a18332815
98 changed files with 2171 additions and 1727 deletions

View file

@ -51,12 +51,30 @@ options:
interconnect:
description:
- URL of the underlying Interconnect object that this attachment's traffic will
traverse through.
required: true
traverse through. Required if type is DEDICATED, must not be set if type is
PARTNER.
required: false
description:
description:
- An optional description of this resource.
required: false
edge_availability_domain:
description:
- Desired availability domain for the attachment. Only available for type PARTNER,
at creation time. For improved reliability, customers should configure a pair
of attachments with one per availability domain. The selected availability domain
will be provided to the Partner via the pairing key so that the provisioned
circuit will lie in the specified domain. If not specified, the value will default
to AVAILABILITY_DOMAIN_ANY.
required: false
type:
description:
- The type of InterconnectAttachment you wish to create. Defaults to DEDICATED.
required: false
choices:
- DEDICATED
- PARTNER
- PARTNER_PROVIDER
router:
description:
- URL of the cloud router to be used for dynamic routing. This router must be
@ -64,9 +82,10 @@ options:
will automatically connect the Interconnect to the network & region within which
the Cloud Router is configured.
- 'This field represents a link to a Router resource in GCP. It can be specified
in two ways. First, you can place in the selfLink of the resource here as a
string Alternatively, you can add `register: name-of-resource` to a gcp_compute_router
task and then set this router field to "{{ name-of-resource }}"'
in two ways. First, you can place a dictionary with key ''selfLink'' and value
of your resource''s selfLink Alternatively, you can add `register: name-of-resource`
to a gcp_compute_router task and then set this router field to "{{ name-of-resource
}}"'
required: true
name:
description:
@ -89,7 +108,8 @@ options:
required: false
vlan_tag8021q:
description:
- The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094.
- The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When using
PARTNER type this will be managed upstream.
required: false
region:
description:
@ -101,14 +121,14 @@ extends_documentation_fragment: gcp
EXAMPLES = '''
- name: create a interconnect attachment
gcp_compute_interconnect_attachment:
name: "test_object"
region: us-central1
project: "test_project"
auth_kind: "serviceaccount"
interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/...
router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/...
service_account_file: "/tmp/auth.pem"
state: present
name: test_object
region: us-central1
project: test_project
auth_kind: serviceaccount
interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/...
router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/...
service_account_file: "/tmp/auth.pem"
state: present
register: disk
'''
@ -128,7 +148,7 @@ customerRouterIpAddress:
interconnect:
description:
- URL of the underlying Interconnect object that this attachment's traffic will
traverse through.
traverse through. Required if type is DEDICATED, must not be set if type is PARTNER.
returned: success
type: str
description:
@ -136,6 +156,30 @@ description:
- An optional description of this resource.
returned: success
type: str
edgeAvailabilityDomain:
description:
- Desired availability domain for the attachment. Only available for type PARTNER,
at creation time. For improved reliability, customers should configure a pair
of attachments with one per availability domain. The selected availability domain
will be provided to the Partner via the pairing key so that the provisioned circuit
will lie in the specified domain. If not specified, the value will default to
AVAILABILITY_DOMAIN_ANY.
returned: success
type: str
pairingKey:
description:
- '[Output only for type PARTNER. Not present for DEDICATED]. The opaque identifier
of an PARTNER attachment used to initiate provisioning with a selected partner.
Of the form "XXXXX/region/domain" .'
returned: success
type: str
partnerAsn:
description:
- "[Output only for type PARTNER. Not present for DEDICATED]. Optional BGP ASN for
the router that should be supplied by a layer 3 Partner if they configured BGP
on behalf of the customer."
returned: success
type: str
privateInterconnectInfo:
description:
- Information specific to an InterconnectAttachment. This property is populated
@ -149,6 +193,16 @@ privateInterconnectInfo:
going to and from this network and region.
returned: success
type: int
type:
description:
- The type of InterconnectAttachment you wish to create. Defaults to DEDICATED.
returned: success
type: str
state:
description:
- "[Output Only] The current state of this attachment's functionality."
returned: success
type: str
googleReferenceId:
description:
- Google reference ID, to be used when raising support tickets with Google or otherwise
@ -162,7 +216,7 @@ router:
automatically connect the Interconnect to the network & region within which the
Cloud Router is configured.
returned: success
type: str
type: dict
creationTimestamp:
description:
- Creation timestamp in RFC3339 text format.
@ -196,7 +250,8 @@ candidateSubnets:
type: list
vlanTag8021q:
description:
- The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094.
- The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When using
PARTNER type this will be managed upstream.
returned: success
type: int
region:
@ -226,9 +281,11 @@ def main():
module = GcpModule(
argument_spec=dict(
state=dict(default='present', choices=['present', 'absent'], type='str'),
interconnect=dict(required=True, type='str'),
interconnect=dict(type='str'),
description=dict(type='str'),
router=dict(required=True),
edge_availability_domain=dict(type='str'),
type=dict(type='str', choices=['DEDICATED', 'PARTNER', 'PARTNER_PROVIDER']),
router=dict(required=True, type='dict'),
name=dict(required=True, type='str'),
candidate_subnets=dict(type='list', elements='str'),
vlan_tag8021q=dict(type='int'),
@ -273,7 +330,8 @@ def create(module, link, kind):
def update(module, link, kind):
module.fail_json(msg="InterconnectAttachment cannot be edited")
delete(module, self_link(module), kind)
create(module, collection(module), kind)
def delete(module, link, kind):
@ -286,6 +344,8 @@ def resource_to_request(module):
u'kind': 'compute#interconnectAttachment',
u'interconnect': module.params.get('interconnect'),
u'description': module.params.get('description'),
u'edgeAvailabilityDomain': module.params.get('edge_availability_domain'),
u'type': module.params.get('type'),
u'router': replace_resource_dict(module.params.get(u'router', {}), 'selfLink'),
u'name': module.params.get('name'),
u'candidateSubnets': module.params.get('candidate_subnets'),
@ -359,7 +419,12 @@ def response_to_hash(module, response):
u'customerRouterIpAddress': response.get(u'customerRouterIpAddress'),
u'interconnect': response.get(u'interconnect'),
u'description': response.get(u'description'),
u'edgeAvailabilityDomain': response.get(u'edgeAvailabilityDomain'),
u'pairingKey': response.get(u'pairingKey'),
u'partnerAsn': response.get(u'partnerAsn'),
u'privateInterconnectInfo': InterconnectAttachmentPrivateinterconnectinfo(response.get(u'privateInterconnectInfo', {}), module).from_response(),
u'type': response.get(u'type'),
u'state': response.get(u'state'),
u'googleReferenceId': response.get(u'googleReferenceId'),
u'router': response.get(u'router'),
u'creationTimestamp': response.get(u'creationTimestamp'),
@ -423,10 +488,10 @@ class InterconnectAttachmentPrivateinterconnectinfo(object):
self.request = {}
def to_request(self):
return remove_nones_from_dict({u'tag8021q': self.request.get('tag8021q')})
return remove_nones_from_dict({})
def from_response(self):
return remove_nones_from_dict({u'tag8021q': self.request.get(u'tag8021q')})
return remove_nones_from_dict({})
if __name__ == '__main__':