Skip to content

Commit

Permalink
adding fields to compute#instance.accessConfigs[] (#23)
Browse files Browse the repository at this point in the history
adding fields to compute#instance.accessConfigs[]
  • Loading branch information
rambleraptor authored Oct 16, 2019
2 parents bc4c90a + 8013a6b commit e0d101b
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 6 deletions.
76 changes: 73 additions & 3 deletions plugins/modules/gcp_compute_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,32 @@
- 'Some valid choices include: "ONE_TO_ONE_NAT"'
required: true
type: str
set_public_ptr:
description:
- Specifies whether a public DNS PTR record should be created to map the
external IP address of the instance to a DNS domain name.
required: false
type: bool
version_added: '2.10'
public_ptr_domain_name:
description:
- The DNS domain name for the public PTR record. You can set this field
only if the setPublicPtr field is enabled.
required: false
type: str
version_added: '2.10'
network_tier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid external
IP address, an ephemeral IP will be created with this networkTier. If
an AccessConfig with a valid external IP address is specified, it must
match that of the networkTier associated with the Address resource owning
that IP.
- 'Some valid choices include: "PREMIUM", "STANDARD"'
required: false
type: str
version_added: '2.10'
alias_ip_ranges:
description:
- An array of alias IP ranges for this network interface. Can only be specified
Expand Down Expand Up @@ -841,6 +867,27 @@
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
returned: success
type: str
setPublicPtr:
description:
- Specifies whether a public DNS PTR record should be created to map the
external IP address of the instance to a DNS domain name.
returned: success
type: bool
publicPtrDomainName:
description:
- The DNS domain name for the public PTR record. You can set this field
only if the setPublicPtr field is enabled.
returned: success
type: str
networkTier:
description:
- This signifies the networking tier used for configuring this access configuration.
If an AccessConfig is specified without a valid external IP address, an
ephemeral IP will be created with this networkTier. If an AccessConfig
with a valid external IP address is specified, it must match that of the
networkTier associated with the Address resource owning that IP.
returned: success
type: str
aliasIpRanges:
description:
- An array of alias IP ranges for this network interface. Can only be specified
Expand Down Expand Up @@ -1069,7 +1116,14 @@ def main():
access_configs=dict(
type='list',
elements='dict',
options=dict(name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str')),
options=dict(
name=dict(required=True, type='str'),
nat_ip=dict(type='dict'),
type=dict(required=True, type='str'),
set_public_ptr=dict(type='bool'),
public_ptr_domain_name=dict(type='str'),
network_tier=dict(type='str'),
),
),
alias_ip_ranges=dict(type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))),
network=dict(type='dict'),
Expand Down Expand Up @@ -1648,11 +1702,27 @@ def from_response(self):

def _request_for_item(self, item):
return remove_nones_from_dict(
{u'name': item.get('name'), u'natIP': replace_resource_dict(item.get(u'nat_ip', {}), 'address'), u'type': item.get('type')}
{
u'name': item.get('name'),
u'natIP': replace_resource_dict(item.get(u'nat_ip', {}), 'address'),
u'type': item.get('type'),
u'setPublicPtr': item.get('set_public_ptr'),
u'publicPtrDomainName': item.get('public_ptr_domain_name'),
u'networkTier': item.get('network_tier'),
}
)

def _response_from_item(self, item):
return remove_nones_from_dict({u'name': item.get(u'name'), u'natIP': item.get(u'natIP'), u'type': item.get(u'type')})
return remove_nones_from_dict(
{
u'name': item.get(u'name'),
u'natIP': item.get(u'natIP'),
u'type': item.get(u'type'),
u'setPublicPtr': item.get(u'setPublicPtr'),
u'publicPtrDomainName': item.get(u'publicPtrDomainName'),
u'networkTier': item.get(u'networkTier'),
}
)


class InstanceAliasiprangesArray(object):
Expand Down
22 changes: 22 additions & 0 deletions plugins/modules/gcp_compute_instance_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,28 @@
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
returned: success
type: str
setPublicPtr:
description:
- Specifies whether a public DNS PTR record should be created to map
the external IP address of the instance to a DNS domain name.
returned: success
type: bool
publicPtrDomainName:
description:
- The DNS domain name for the public PTR record. You can set this field
only if the setPublicPtr field is enabled.
returned: success
type: str
networkTier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid external
IP address, an ephemeral IP will be created with this networkTier.
If an AccessConfig with a valid external IP address is specified,
it must match that of the networkTier associated with the Address
resource owning that IP.
returned: success
type: str
aliasIpRanges:
description:
- An array of alias IP ranges for this network interface. Can only be specified
Expand Down
77 changes: 74 additions & 3 deletions plugins/modules/gcp_compute_instance_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,32 @@
- 'Some valid choices include: "ONE_TO_ONE_NAT"'
required: true
type: str
set_public_ptr:
description:
- Specifies whether a public DNS PTR record should be created to map
the external IP address of the instance to a DNS domain name.
required: false
type: bool
version_added: '2.10'
public_ptr_domain_name:
description:
- The DNS domain name for the public PTR record. You can set this
field only if the setPublicPtr field is enabled.
required: false
type: str
version_added: '2.10'
network_tier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid external
IP address, an ephemeral IP will be created with this networkTier.
If an AccessConfig with a valid external IP address is specified,
it must match that of the networkTier associated with the Address
resource owning that IP.
- 'Some valid choices include: "PREMIUM", "STANDARD"'
required: false
type: str
version_added: '2.10'
alias_ip_ranges:
description:
- An array of alias IP ranges for this network interface. Can only be
Expand Down Expand Up @@ -792,6 +818,28 @@
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
returned: success
type: str
setPublicPtr:
description:
- Specifies whether a public DNS PTR record should be created to map
the external IP address of the instance to a DNS domain name.
returned: success
type: bool
publicPtrDomainName:
description:
- The DNS domain name for the public PTR record. You can set this field
only if the setPublicPtr field is enabled.
returned: success
type: str
networkTier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid external
IP address, an ephemeral IP will be created with this networkTier.
If an AccessConfig with a valid external IP address is specified,
it must match that of the networkTier associated with the Address
resource owning that IP.
returned: success
type: str
aliasIpRanges:
description:
- An array of alias IP ranges for this network interface. Can only be specified
Expand Down Expand Up @@ -987,7 +1035,14 @@ def main():
access_configs=dict(
type='list',
elements='dict',
options=dict(name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str')),
options=dict(
name=dict(required=True, type='str'),
nat_ip=dict(type='dict'),
type=dict(required=True, type='str'),
set_public_ptr=dict(type='bool'),
public_ptr_domain_name=dict(type='str'),
network_tier=dict(type='str'),
),
),
alias_ip_ranges=dict(
type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))
Expand Down Expand Up @@ -1490,11 +1545,27 @@ def from_response(self):

def _request_for_item(self, item):
return remove_nones_from_dict(
{u'name': item.get('name'), u'natIP': replace_resource_dict(item.get(u'nat_ip', {}), 'address'), u'type': item.get('type')}
{
u'name': item.get('name'),
u'natIP': replace_resource_dict(item.get(u'nat_ip', {}), 'address'),
u'type': item.get('type'),
u'setPublicPtr': item.get('set_public_ptr'),
u'publicPtrDomainName': item.get('public_ptr_domain_name'),
u'networkTier': item.get('network_tier'),
}
)

def _response_from_item(self, item):
return remove_nones_from_dict({u'name': item.get(u'name'), u'natIP': item.get(u'natIP'), u'type': item.get(u'type')})
return remove_nones_from_dict(
{
u'name': item.get(u'name'),
u'natIP': item.get(u'natIP'),
u'type': item.get(u'type'),
u'setPublicPtr': item.get(u'setPublicPtr'),
u'publicPtrDomainName': item.get(u'publicPtrDomainName'),
u'networkTier': item.get(u'networkTier'),
}
)


class InstanceTemplateAliasiprangesArray(object):
Expand Down
22 changes: 22 additions & 0 deletions plugins/modules/gcp_compute_instance_template_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,28 @@
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
returned: success
type: str
setPublicPtr:
description:
- Specifies whether a public DNS PTR record should be created to
map the external IP address of the instance to a DNS domain name.
returned: success
type: bool
publicPtrDomainName:
description:
- The DNS domain name for the public PTR record. You can set this
field only if the setPublicPtr field is enabled.
returned: success
type: str
networkTier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid
external IP address, an ephemeral IP will be created with this
networkTier. If an AccessConfig with a valid external IP address
is specified, it must match that of the networkTier associated
with the Address resource owning that IP.
returned: success
type: str
aliasIpRanges:
description:
- An array of alias IP ranges for this network interface. Can only be
Expand Down

0 comments on commit e0d101b

Please sign in to comment.