mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-06-02 23:19:11 -07:00
Object.input should == noneditable (#62)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
fc87db420b
commit
7c4d1c582b
12 changed files with 169 additions and 375 deletions
|
@ -123,11 +123,6 @@ options:
|
|||
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
|
||||
encryption key to either encrypt or decrypt this resource.
|
||||
required: false
|
||||
sha256:
|
||||
description:
|
||||
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
|
||||
encryption key that protects this resource.
|
||||
required: false
|
||||
index:
|
||||
description:
|
||||
- Assigns a zero-based index to this disk, where 0 is reserved for the
|
||||
|
@ -179,11 +174,6 @@ options:
|
|||
- Specifies a 256-bit customer-supplied encryption key, encoded
|
||||
in RFC 4648 base64 to either encrypt or decrypt this resource.
|
||||
required: false
|
||||
sha256:
|
||||
description:
|
||||
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
|
||||
encryption key that protects this resource.
|
||||
required: false
|
||||
interface:
|
||||
description:
|
||||
- Specifies the disk interface to use for attaching this disk, which is
|
||||
|
@ -211,10 +201,10 @@ options:
|
|||
- Note that for InstanceTemplate, specify the disk name, not the URL for
|
||||
the disk.
|
||||
- 'This field represents a link to a Disk resource in GCP. It can be specified
|
||||
in two ways. First, you can place in the name of the resource here as
|
||||
a string Alternatively, you can add `register: name-of-resource` to
|
||||
a gcp_compute_disk task and then set this source field to "{{ name-of-resource
|
||||
}}"'
|
||||
in two ways. First, you can place a dictionary with key ''name'' and
|
||||
value of your resource''s name Alternatively, you can add `register:
|
||||
name-of-resource` to a gcp_compute_disk task and then set this source
|
||||
field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
type:
|
||||
description:
|
||||
|
@ -283,10 +273,10 @@ options:
|
|||
IP address pool. If you specify a static external IP address, it
|
||||
must live in the same region as the zone of the instance.
|
||||
- 'This field represents a link to a Address resource in GCP. It can
|
||||
be specified in two ways. First, you can place in the address of
|
||||
the resource here as a string Alternatively, you can add `register:
|
||||
name-of-resource` to a gcp_compute_address task and then set this
|
||||
nat_ip field to "{{ name-of-resource }}"'
|
||||
be specified in two ways. First, you can place a dictionary with
|
||||
key ''address'' and value of your resource''s address Alternatively,
|
||||
you can add `register: name-of-resource` to a gcp_compute_address
|
||||
task and then set this nat_ip field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
type:
|
||||
description:
|
||||
|
@ -315,11 +305,6 @@ options:
|
|||
range. If left unspecified, the primary range of the subnetwork
|
||||
will be used.
|
||||
required: false
|
||||
name:
|
||||
description:
|
||||
- The name of the network interface, generated by the server. For network
|
||||
devices, these are eth0, eth1, etc .
|
||||
required: false
|
||||
network:
|
||||
description:
|
||||
- Specifies the title of an existing network. When creating an instance,
|
||||
|
@ -327,10 +312,10 @@ options:
|
|||
network global/networks/default is used; if the network is not specified
|
||||
but the subnetwork is specified, the network is inferred.
|
||||
- 'This field represents a link to a Network 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_network task and then set this network field to "{{
|
||||
name-of-resource }}"'
|
||||
specified 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_network task and then set this network
|
||||
field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
network_ip:
|
||||
description:
|
||||
|
@ -345,10 +330,10 @@ options:
|
|||
If the network is in auto subnet mode, providing the subnetwork is optional.
|
||||
If the network is in custom subnet mode, then this field should be specified.
|
||||
- 'This field represents a link to a Subnetwork 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_subnetwork task and then set this subnetwork field
|
||||
to "{{ name-of-resource }}"'
|
||||
be specified 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_subnetwork task
|
||||
and then set this subnetwork field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
scheduling:
|
||||
description:
|
||||
|
@ -418,43 +403,43 @@ extends_documentation_fragment: gcp
|
|||
EXAMPLES = '''
|
||||
- name: create a network
|
||||
gcp_compute_network:
|
||||
name: "network-instancetemplate"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: network-instancetemplate
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: network
|
||||
|
||||
- name: create a address
|
||||
gcp_compute_address:
|
||||
name: "address-instancetemplate"
|
||||
region: us-west1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: address-instancetemplate
|
||||
region: us-west1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: address
|
||||
|
||||
- name: create a instance template
|
||||
gcp_compute_instance_template:
|
||||
name: "test_object"
|
||||
properties:
|
||||
disks:
|
||||
- auto_delete: true
|
||||
boot: true
|
||||
initialize_params:
|
||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
||||
machine_type: n1-standard-1
|
||||
network_interfaces:
|
||||
- network: "{{ network }}"
|
||||
access_configs:
|
||||
- name: test-config
|
||||
type: ONE_TO_ONE_NAT
|
||||
nat_ip: "{{ address }}"
|
||||
project: "test_project"
|
||||
auth_kind: "serviceaccount"
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
name: test_object
|
||||
properties:
|
||||
disks:
|
||||
- auto_delete: 'true'
|
||||
boot: 'true'
|
||||
initialize_params:
|
||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
||||
machine_type: n1-standard-1
|
||||
network_interfaces:
|
||||
- network: "{{ network }}"
|
||||
access_configs:
|
||||
- name: test-config
|
||||
type: ONE_TO_ONE_NAT
|
||||
nat_ip: "{{ address }}"
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
state: present
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
@ -641,7 +626,7 @@ properties:
|
|||
- Note that for InstanceTemplate, specify the disk name, not the URL for
|
||||
the disk.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
type:
|
||||
description:
|
||||
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified,
|
||||
|
@ -714,7 +699,7 @@ properties:
|
|||
IP address pool. If you specify a static external IP address, it must
|
||||
live in the same region as the zone of the instance.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
type:
|
||||
description:
|
||||
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
|
||||
|
@ -756,7 +741,7 @@ properties:
|
|||
global/networks/default is used; if the network is not specified but the
|
||||
subnetwork is specified, the network is inferred.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
networkIP:
|
||||
description:
|
||||
- An IPv4 internal network address to assign to the instance for this network
|
||||
|
@ -771,7 +756,7 @@ properties:
|
|||
If the network is in auto subnet mode, providing the subnetwork is optional.
|
||||
If the network is in custom subnet mode, then this field should be specified.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
scheduling:
|
||||
description:
|
||||
- Sets the scheduling options for this instance.
|
||||
|
@ -878,9 +863,7 @@ def main():
|
|||
auto_delete=dict(type='bool'),
|
||||
boot=dict(type='bool'),
|
||||
device_name=dict(type='str'),
|
||||
disk_encryption_key=dict(
|
||||
type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'), sha256=dict(type='str'))
|
||||
),
|
||||
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'))),
|
||||
index=dict(type='int'),
|
||||
initialize_params=dict(
|
||||
type='dict',
|
||||
|
@ -889,12 +872,12 @@ def main():
|
|||
disk_size_gb=dict(type='int'),
|
||||
disk_type=dict(type='str'),
|
||||
source_image=dict(type='str'),
|
||||
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'))),
|
||||
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
||||
),
|
||||
),
|
||||
interface=dict(type='str', choices=['SCSI', 'NVME']),
|
||||
mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']),
|
||||
source=dict(),
|
||||
source=dict(type='dict'),
|
||||
type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']),
|
||||
),
|
||||
),
|
||||
|
@ -910,16 +893,17 @@ def main():
|
|||
type='list',
|
||||
elements='dict',
|
||||
options=dict(
|
||||
name=dict(required=True, type='str'), nat_ip=dict(), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])
|
||||
name=dict(required=True, type='str'),
|
||||
nat_ip=dict(type='dict'),
|
||||
type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT']),
|
||||
),
|
||||
),
|
||||
alias_ip_ranges=dict(
|
||||
type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))
|
||||
),
|
||||
name=dict(type='str'),
|
||||
network=dict(),
|
||||
network=dict(type='dict'),
|
||||
network_ip=dict(type='str'),
|
||||
subnetwork=dict(),
|
||||
subnetwork=dict(type='dict'),
|
||||
),
|
||||
),
|
||||
scheduling=dict(
|
||||
|
@ -1255,14 +1239,10 @@ class InstanceTemplateDiskencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
def to_request(self):
|
||||
return remove_nones_from_dict(
|
||||
{u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key'), u'sha256': self.request.get('sha256')}
|
||||
)
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key')})
|
||||
|
||||
def from_response(self):
|
||||
return remove_nones_from_dict(
|
||||
{u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey'), u'sha256': self.request.get(u'sha256')}
|
||||
)
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey')})
|
||||
|
||||
|
||||
class InstanceTemplateInitializeparams(object):
|
||||
|
@ -1309,10 +1289,10 @@ class InstanceTemplateSourceimageencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
def to_request(self):
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')})
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
|
||||
|
||||
def from_response(self):
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')})
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
|
||||
|
||||
|
||||
class InstanceTemplateGuestacceleratorsArray(object):
|
||||
|
@ -1367,7 +1347,6 @@ class InstanceTemplateNetworkinterfacesArray(object):
|
|||
{
|
||||
u'accessConfigs': InstanceTemplateAccessconfigsArray(item.get('access_configs', []), self.module).to_request(),
|
||||
u'aliasIpRanges': InstanceTemplateAliasiprangesArray(item.get('alias_ip_ranges', []), self.module).to_request(),
|
||||
u'name': item.get('name'),
|
||||
u'network': replace_resource_dict(item.get(u'network', {}), 'selfLink'),
|
||||
u'networkIP': item.get('network_ip'),
|
||||
u'subnetwork': replace_resource_dict(item.get(u'subnetwork', {}), 'selfLink'),
|
||||
|
@ -1379,7 +1358,6 @@ class InstanceTemplateNetworkinterfacesArray(object):
|
|||
{
|
||||
u'accessConfigs': InstanceTemplateAccessconfigsArray(item.get(u'accessConfigs', []), self.module).from_response(),
|
||||
u'aliasIpRanges': InstanceTemplateAliasiprangesArray(item.get(u'aliasIpRanges', []), self.module).from_response(),
|
||||
u'name': item.get(u'name'),
|
||||
u'network': item.get(u'network'),
|
||||
u'networkIP': item.get(u'networkIP'),
|
||||
u'subnetwork': item.get(u'subnetwork'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue