|
|
|
@ -122,7 +122,9 @@ options:
|
|
|
|
|
required: false
|
|
|
|
|
disk_type:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to DiskType resource.
|
|
|
|
|
- Reference to a gcompute_disk_type resource.
|
|
|
|
|
- Specifies the disk type to use to create the instance.
|
|
|
|
|
- If not specified, the default is pd-standard.
|
|
|
|
|
required: false
|
|
|
|
|
source_image:
|
|
|
|
|
description:
|
|
|
|
@ -165,7 +167,10 @@ options:
|
|
|
|
|
choices: ['READ_WRITE', 'READ_ONLY']
|
|
|
|
|
source:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Disk resource.
|
|
|
|
|
- Reference to a gcompute_disk resource. When creating a new instance, one of initializeParams.sourceImage
|
|
|
|
|
or disks.source is required.
|
|
|
|
|
- If desired, you can also attach existing non-root persistent disks using this property.
|
|
|
|
|
This field is only applicable for persistent disks.
|
|
|
|
|
required: false
|
|
|
|
|
type:
|
|
|
|
|
description:
|
|
|
|
@ -200,7 +205,7 @@ options:
|
|
|
|
|
required: false
|
|
|
|
|
machine_type:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to MachineType resource.
|
|
|
|
|
- A reference to a machine type which defines VM kind.
|
|
|
|
|
required: false
|
|
|
|
|
min_cpu_platform:
|
|
|
|
|
description:
|
|
|
|
@ -238,8 +243,13 @@ options:
|
|
|
|
|
required: true
|
|
|
|
|
nat_ip:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Address resource.
|
|
|
|
|
required: true
|
|
|
|
|
- Specifies the title of a gcompute_address.
|
|
|
|
|
- An external IP address associated with this instance.
|
|
|
|
|
- Specify an unused static external IP address available to the project or leave this
|
|
|
|
|
field undefined to use an IP from a shared ephemeral IP address pool. If you specify
|
|
|
|
|
a static external IP address, it must live in the same region as the zone of the
|
|
|
|
|
instance.
|
|
|
|
|
required: false
|
|
|
|
|
type:
|
|
|
|
|
description:
|
|
|
|
|
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
|
|
|
|
@ -272,7 +282,10 @@ options:
|
|
|
|
|
required: false
|
|
|
|
|
network:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Network resource.
|
|
|
|
|
- Specifies the title of an existing gcompute_network. When creating an instance,
|
|
|
|
|
if neither the network nor the subnetwork is specified, the default network global/networks/default
|
|
|
|
|
is used; if the network is not specified but the subnetwork is specified, the network
|
|
|
|
|
is inferred.
|
|
|
|
|
required: false
|
|
|
|
|
network_ip:
|
|
|
|
|
description:
|
|
|
|
@ -281,7 +294,10 @@ options:
|
|
|
|
|
required: false
|
|
|
|
|
subnetwork:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Subnetwork resource.
|
|
|
|
|
- Reference to a gcompute_subnetwork resource.
|
|
|
|
|
- If the network resource is in legacy mode, do not provide this property. 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.
|
|
|
|
|
required: false
|
|
|
|
|
scheduling:
|
|
|
|
|
description:
|
|
|
|
@ -345,7 +361,7 @@ options:
|
|
|
|
|
required: false
|
|
|
|
|
zone:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Zone resource.
|
|
|
|
|
- A reference to the zone where the machine resides.
|
|
|
|
|
required: true
|
|
|
|
|
extends_documentation_fragment: gcp
|
|
|
|
|
'''
|
|
|
|
@ -353,64 +369,56 @@ extends_documentation_fragment: gcp
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
|
- name: create a disk
|
|
|
|
|
gcp_compute_disk:
|
|
|
|
|
name: 'disk-instance'
|
|
|
|
|
name: "disk-instance"
|
|
|
|
|
size_gb: 50
|
|
|
|
|
source_image: 'projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts'
|
|
|
|
|
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
|
|
|
|
zone: us-central1-a
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/compute
|
|
|
|
|
state: present
|
|
|
|
|
register: disk
|
|
|
|
|
|
|
|
|
|
- name: create a network
|
|
|
|
|
gcp_compute_network:
|
|
|
|
|
name: 'network-instance'
|
|
|
|
|
name: "network-instance"
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/compute
|
|
|
|
|
state: present
|
|
|
|
|
register: network
|
|
|
|
|
|
|
|
|
|
- name: create a address
|
|
|
|
|
gcp_compute_address:
|
|
|
|
|
name: 'address-instance'
|
|
|
|
|
region: 'us-central1'
|
|
|
|
|
name: "address-instance"
|
|
|
|
|
region: us-central1
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/compute
|
|
|
|
|
state: present
|
|
|
|
|
register: address
|
|
|
|
|
|
|
|
|
|
- name: create a instance
|
|
|
|
|
gcp_compute_instance:
|
|
|
|
|
name: testObject
|
|
|
|
|
name: "test_object"
|
|
|
|
|
machine_type: n1-standard-1
|
|
|
|
|
disks:
|
|
|
|
|
- auto_delete: true
|
|
|
|
|
boot: true
|
|
|
|
|
source: "{{ disk }}"
|
|
|
|
|
metadata:
|
|
|
|
|
startup-script-url: 'gs:://graphite-playground/bootstrap.sh'
|
|
|
|
|
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
|
|
|
|
cost-center: '12345'
|
|
|
|
|
network_interfaces:
|
|
|
|
|
- network: "{{ network }}"
|
|
|
|
|
access_configs:
|
|
|
|
|
- name: 'External NAT'
|
|
|
|
|
- name: External NAT
|
|
|
|
|
nat_ip: "{{ address }}"
|
|
|
|
|
type: 'ONE_TO_ONE_NAT'
|
|
|
|
|
zone: 'us-central1-a'
|
|
|
|
|
project: testProject
|
|
|
|
|
auth_kind: service_account
|
|
|
|
|
service_account_file: /tmp/auth.pem
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/compute
|
|
|
|
|
type: ONE_TO_ONE_NAT
|
|
|
|
|
zone: us-central1-a
|
|
|
|
|
project: "test_project"
|
|
|
|
|
auth_kind: "service_account"
|
|
|
|
|
service_account_file: "/tmp/auth.pem"
|
|
|
|
|
state: present
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
@ -511,7 +519,9 @@ RETURN = '''
|
|
|
|
|
type: int
|
|
|
|
|
disk_type:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to DiskType resource.
|
|
|
|
|
- Reference to a gcompute_disk_type resource.
|
|
|
|
|
- Specifies the disk type to use to create the instance.
|
|
|
|
|
- If not specified, the default is pd-standard.
|
|
|
|
|
returned: success
|
|
|
|
|
type: str
|
|
|
|
|
source_image:
|
|
|
|
@ -559,7 +569,10 @@ RETURN = '''
|
|
|
|
|
type: str
|
|
|
|
|
source:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Disk resource.
|
|
|
|
|
- Reference to a gcompute_disk resource. When creating a new instance, one of initializeParams.sourceImage
|
|
|
|
|
or disks.source is required.
|
|
|
|
|
- If desired, you can also attach existing non-root persistent disks using this property.
|
|
|
|
|
This field is only applicable for persistent disks.
|
|
|
|
|
returned: success
|
|
|
|
|
type: dict
|
|
|
|
|
type:
|
|
|
|
@ -605,7 +618,7 @@ RETURN = '''
|
|
|
|
|
type: dict
|
|
|
|
|
machine_type:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to MachineType resource.
|
|
|
|
|
- A reference to a machine type which defines VM kind.
|
|
|
|
|
returned: success
|
|
|
|
|
type: str
|
|
|
|
|
min_cpu_platform:
|
|
|
|
@ -649,7 +662,12 @@ RETURN = '''
|
|
|
|
|
type: str
|
|
|
|
|
nat_ip:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Address resource.
|
|
|
|
|
- Specifies the title of a gcompute_address.
|
|
|
|
|
- An external IP address associated with this instance.
|
|
|
|
|
- Specify an unused static external IP address available to the project or leave this
|
|
|
|
|
field undefined to use an IP from a shared ephemeral 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: dict
|
|
|
|
|
type:
|
|
|
|
@ -688,7 +706,10 @@ RETURN = '''
|
|
|
|
|
type: str
|
|
|
|
|
network:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Network resource.
|
|
|
|
|
- Specifies the title of an existing gcompute_network. When creating an instance,
|
|
|
|
|
if neither the network nor the subnetwork is specified, the default network global/networks/default
|
|
|
|
|
is used; if the network is not specified but the subnetwork is specified, the network
|
|
|
|
|
is inferred.
|
|
|
|
|
returned: success
|
|
|
|
|
type: dict
|
|
|
|
|
network_ip:
|
|
|
|
@ -699,7 +720,10 @@ RETURN = '''
|
|
|
|
|
type: str
|
|
|
|
|
subnetwork:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Subnetwork resource.
|
|
|
|
|
- Reference to a gcompute_subnetwork resource.
|
|
|
|
|
- If the network resource is in legacy mode, do not provide this property. 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: dict
|
|
|
|
|
scheduling:
|
|
|
|
@ -741,7 +765,7 @@ RETURN = '''
|
|
|
|
|
description:
|
|
|
|
|
- Email address of the service account.
|
|
|
|
|
returned: success
|
|
|
|
|
type: bool
|
|
|
|
|
type: str
|
|
|
|
|
scopes:
|
|
|
|
|
description:
|
|
|
|
|
- The list of scopes to be made available for this service account.
|
|
|
|
@ -783,7 +807,7 @@ RETURN = '''
|
|
|
|
|
type: list
|
|
|
|
|
zone:
|
|
|
|
|
description:
|
|
|
|
|
- A reference to Zone resource.
|
|
|
|
|
- A reference to the zone where the machine resides.
|
|
|
|
|
returned: success
|
|
|
|
|
type: str
|
|
|
|
|
'''
|
|
|
|
@ -846,7 +870,7 @@ def main():
|
|
|
|
|
network_interfaces=dict(type='list', elements='dict', options=dict(
|
|
|
|
|
access_configs=dict(type='list', elements='dict', options=dict(
|
|
|
|
|
name=dict(required=True, type='str'),
|
|
|
|
|
nat_ip=dict(required=True, type='dict'),
|
|
|
|
|
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(
|
|
|
|
@ -875,6 +899,9 @@ def main():
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if not module.params['scopes']:
|
|
|
|
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
|
|
|
|
|
|
|
|
|
state = module.params['state']
|
|
|
|
|
kind = 'compute#instance'
|
|
|
|
|
|
|
|
|
@ -884,10 +911,10 @@ def main():
|
|
|
|
|
if fetch:
|
|
|
|
|
if state == 'present':
|
|
|
|
|
if is_different(module, fetch):
|
|
|
|
|
fetch = update(module, self_link(module), kind, fetch)
|
|
|
|
|
fetch = update(module, self_link(module), kind)
|
|
|
|
|
changed = True
|
|
|
|
|
else:
|
|
|
|
|
delete(module, self_link(module), kind, fetch)
|
|
|
|
|
delete(module, self_link(module), kind)
|
|
|
|
|
fetch = {}
|
|
|
|
|
changed = True
|
|
|
|
|
else:
|
|
|
|
@ -907,12 +934,12 @@ def create(module, link, kind):
|
|
|
|
|
return wait_for_operation(module, auth.post(link, resource_to_request(module)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def update(module, link, kind, fetch):
|
|
|
|
|
def update(module, link, kind):
|
|
|
|
|
auth = GcpSession(module, 'compute')
|
|
|
|
|
return wait_for_operation(module, auth.put(link, resource_to_request(module)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def delete(module, link, kind, fetch):
|
|
|
|
|
def delete(module, link, kind):
|
|
|
|
|
auth = GcpSession(module, 'compute')
|
|
|
|
|
return wait_for_operation(module, auth.delete(link))
|
|
|
|
|
|
|
|
|
@ -922,15 +949,15 @@ def resource_to_request(module):
|
|
|
|
|
u'kind': 'compute#instance',
|
|
|
|
|
u'canIpForward': module.params.get('can_ip_forward'),
|
|
|
|
|
u'disks': InstanceDisksArray(module.params.get('disks', []), module).to_request(),
|
|
|
|
|
u'guestAccelerators': InstancGuestAccelerArray(module.params.get('guest_accelerators', []), module).to_request(),
|
|
|
|
|
u'guestAccelerators': InstanceGuestAcceleratorsArray(module.params.get('guest_accelerators', []), module).to_request(),
|
|
|
|
|
u'labelFingerprint': module.params.get('label_fingerprint'),
|
|
|
|
|
u'metadata': module.params.get('metadata'),
|
|
|
|
|
u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params),
|
|
|
|
|
u'minCpuPlatform': module.params.get('min_cpu_platform'),
|
|
|
|
|
u'name': module.params.get('name'),
|
|
|
|
|
u'networkInterfaces': InstancNetworkInterfaArray(module.params.get('network_interfaces', []), module).to_request(),
|
|
|
|
|
u'networkInterfaces': InstanceNetworkInterfacesArray(module.params.get('network_interfaces', []), module).to_request(),
|
|
|
|
|
u'scheduling': InstanceScheduling(module.params.get('scheduling', {}), module).to_request(),
|
|
|
|
|
u'serviceAccounts': InstancServiceAccountArray(module.params.get('service_accounts', []), module).to_request(),
|
|
|
|
|
u'serviceAccounts': InstanceServiceAccountsArray(module.params.get('service_accounts', []), module).to_request(),
|
|
|
|
|
u'tags': InstanceTags(module.params.get('tags', {}), module).to_request()
|
|
|
|
|
}
|
|
|
|
|
request = encode_request(request, module)
|
|
|
|
@ -1007,16 +1034,16 @@ def response_to_hash(module, response):
|
|
|
|
|
u'cpuPlatform': response.get(u'cpuPlatform'),
|
|
|
|
|
u'creationTimestamp': response.get(u'creationTimestamp'),
|
|
|
|
|
u'disks': InstanceDisksArray(module.params.get('disks', []), module).to_request(),
|
|
|
|
|
u'guestAccelerators': InstancGuestAccelerArray(response.get(u'guestAccelerators', []), module).from_response(),
|
|
|
|
|
u'guestAccelerators': InstanceGuestAcceleratorsArray(response.get(u'guestAccelerators', []), module).from_response(),
|
|
|
|
|
u'id': response.get(u'id'),
|
|
|
|
|
u'labelFingerprint': response.get(u'labelFingerprint'),
|
|
|
|
|
u'metadata': response.get(u'metadata'),
|
|
|
|
|
u'machineType': response.get(u'machineType'),
|
|
|
|
|
u'minCpuPlatform': response.get(u'minCpuPlatform'),
|
|
|
|
|
u'name': response.get(u'name'),
|
|
|
|
|
u'networkInterfaces': InstancNetworkInterfaArray(response.get(u'networkInterfaces', []), module).from_response(),
|
|
|
|
|
u'networkInterfaces': InstanceNetworkInterfacesArray(response.get(u'networkInterfaces', []), module).from_response(),
|
|
|
|
|
u'scheduling': InstanceScheduling(response.get(u'scheduling', {}), module).from_response(),
|
|
|
|
|
u'serviceAccounts': InstancServiceAccountArray(response.get(u'serviceAccounts', []), module).from_response(),
|
|
|
|
|
u'serviceAccounts': InstanceServiceAccountsArray(response.get(u'serviceAccounts', []), module).from_response(),
|
|
|
|
|
u'status': response.get(u'status'),
|
|
|
|
|
u'statusMessage': response.get(u'statusMessage'),
|
|
|
|
|
u'tags': InstanceTags(response.get(u'tags', {}), module).from_response()
|
|
|
|
@ -1053,7 +1080,7 @@ def async_op_url(module, extra_data=None):
|
|
|
|
|
def wait_for_operation(module, response):
|
|
|
|
|
op_result = return_if_object(module, response, 'compute#operation')
|
|
|
|
|
if op_result is None:
|
|
|
|
|
return None
|
|
|
|
|
return {}
|
|
|
|
|
status = navigate_hash(op_result, ['status'])
|
|
|
|
|
wait_done = wait_for_completion(status, op_result, module)
|
|
|
|
|
return fetch_resource(module, navigate_hash(wait_done, ['targetLink']), 'compute#instance')
|
|
|
|
@ -1154,9 +1181,9 @@ class InstanceDisksArray(object):
|
|
|
|
|
u'autoDelete': item.get('auto_delete'),
|
|
|
|
|
u'boot': item.get('boot'),
|
|
|
|
|
u'deviceName': item.get('device_name'),
|
|
|
|
|
u'diskEncryptionKey': InstaDiskEncryKey(item.get('disk_encryption_key', {}), self.module).to_request(),
|
|
|
|
|
u'diskEncryptionKey': InstanceDiskEncryptionKey(item.get('disk_encryption_key', {}), self.module).to_request(),
|
|
|
|
|
u'index': item.get('index'),
|
|
|
|
|
u'initializeParams': InstancInitialParams(item.get('initialize_params', {}), self.module).to_request(),
|
|
|
|
|
u'initializeParams': InstanceInitializeParams(item.get('initialize_params', {}), self.module).to_request(),
|
|
|
|
|
u'interface': item.get('interface'),
|
|
|
|
|
u'mode': item.get('mode'),
|
|
|
|
|
u'source': replace_resource_dict(item.get(u'source', {}), 'selfLink'),
|
|
|
|
@ -1168,9 +1195,9 @@ class InstanceDisksArray(object):
|
|
|
|
|
u'autoDelete': item.get(u'autoDelete'),
|
|
|
|
|
u'boot': item.get(u'boot'),
|
|
|
|
|
u'deviceName': item.get(u'deviceName'),
|
|
|
|
|
u'diskEncryptionKey': InstaDiskEncryKey(item.get(u'diskEncryptionKey', {}), self.module).from_response(),
|
|
|
|
|
u'diskEncryptionKey': InstanceDiskEncryptionKey(item.get(u'diskEncryptionKey', {}), self.module).from_response(),
|
|
|
|
|
u'index': item.get(u'index'),
|
|
|
|
|
u'initializeParams': InstancInitialParams(self.module.params.get('initialize_params', {}), self.module).to_request(),
|
|
|
|
|
u'initializeParams': InstanceInitializeParams(self.module.params.get('initialize_params', {}), self.module).to_request(),
|
|
|
|
|
u'interface': item.get(u'interface'),
|
|
|
|
|
u'mode': item.get(u'mode'),
|
|
|
|
|
u'source': item.get(u'source'),
|
|
|
|
@ -1178,7 +1205,7 @@ class InstanceDisksArray(object):
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstaDiskEncryKey(object):
|
|
|
|
|
class InstanceDiskEncryptionKey(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
@ -1201,7 +1228,7 @@ class InstaDiskEncryKey(object):
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstancInitialParams(object):
|
|
|
|
|
class InstanceInitializeParams(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
@ -1215,7 +1242,7 @@ class InstancInitialParams(object):
|
|
|
|
|
u'diskSizeGb': self.request.get('disk_size_gb'),
|
|
|
|
|
u'diskType': disk_type_selflink(self.request.get('disk_type'), self.module.params),
|
|
|
|
|
u'sourceImage': self.request.get('source_image'),
|
|
|
|
|
u'sourceImageEncryptionKey': InstSourImagEncrKey(self.request.get('source_image_encryption_key', {}), self.module).to_request()
|
|
|
|
|
u'sourceImageEncryptionKey': InstanceSourceImageEncryptionKey(self.request.get('source_image_encryption_key', {}), self.module).to_request()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
def from_response(self):
|
|
|
|
@ -1224,11 +1251,11 @@ class InstancInitialParams(object):
|
|
|
|
|
u'diskSizeGb': self.request.get(u'diskSizeGb'),
|
|
|
|
|
u'diskType': self.request.get(u'diskType'),
|
|
|
|
|
u'sourceImage': self.request.get(u'sourceImage'),
|
|
|
|
|
u'sourceImageEncryptionKey': InstSourImagEncrKey(self.request.get(u'sourceImageEncryptionKey', {}), self.module).from_response()
|
|
|
|
|
u'sourceImageEncryptionKey': InstanceSourceImageEncryptionKey(self.request.get(u'sourceImageEncryptionKey', {}), self.module).from_response()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstSourImagEncrKey(object):
|
|
|
|
|
class InstanceSourceImageEncryptionKey(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
@ -1249,7 +1276,7 @@ class InstSourImagEncrKey(object):
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstancGuestAccelerArray(object):
|
|
|
|
|
class InstanceGuestAcceleratorsArray(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
@ -1282,7 +1309,7 @@ class InstancGuestAccelerArray(object):
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstancNetworkInterfaArray(object):
|
|
|
|
|
class InstanceNetworkInterfacesArray(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
@ -1304,8 +1331,8 @@ class InstancNetworkInterfaArray(object):
|
|
|
|
|
|
|
|
|
|
def _request_for_item(self, item):
|
|
|
|
|
return remove_nones_from_dict({
|
|
|
|
|
u'accessConfigs': InstancAccessConfigsArray(item.get('access_configs', []), self.module).to_request(),
|
|
|
|
|
u'aliasIpRanges': InstaAliasIpRangeArray(item.get('alias_ip_ranges', []), self.module).to_request(),
|
|
|
|
|
u'accessConfigs': InstanceAccessConfigsArray(item.get('access_configs', []), self.module).to_request(),
|
|
|
|
|
u'aliasIpRanges': InstanceAliasIpRangesArray(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'),
|
|
|
|
@ -1314,8 +1341,8 @@ class InstancNetworkInterfaArray(object):
|
|
|
|
|
|
|
|
|
|
def _response_from_item(self, item):
|
|
|
|
|
return remove_nones_from_dict({
|
|
|
|
|
u'accessConfigs': InstancAccessConfigsArray(item.get(u'accessConfigs', []), self.module).from_response(),
|
|
|
|
|
u'aliasIpRanges': InstaAliasIpRangeArray(item.get(u'aliasIpRanges', []), self.module).from_response(),
|
|
|
|
|
u'accessConfigs': InstanceAccessConfigsArray(item.get(u'accessConfigs', []), self.module).from_response(),
|
|
|
|
|
u'aliasIpRanges': InstanceAliasIpRangesArray(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'),
|
|
|
|
@ -1323,7 +1350,7 @@ class InstancNetworkInterfaArray(object):
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstancAccessConfigsArray(object):
|
|
|
|
|
class InstanceAccessConfigsArray(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
@ -1358,7 +1385,7 @@ class InstancAccessConfigsArray(object):
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstaAliasIpRangeArray(object):
|
|
|
|
|
class InstanceAliasIpRangesArray(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
@ -1414,7 +1441,7 @@ class InstanceScheduling(object):
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstancServiceAccountArray(object):
|
|
|
|
|
class InstanceServiceAccountsArray(object):
|
|
|
|
|
def __init__(self, request, module):
|
|
|
|
|
self.module = module
|
|
|
|
|
if request:
|
|
|
|
|