Ansible: Instance On/Off

<!-- This change is generated by MagicModules. -->
/cc @rambleraptor
This commit is contained in:
The Magician 2018-11-27 12:22:00 -08:00 committed by Alex Stephen
parent 63b1629d11
commit daaccb8079
2 changed files with 50 additions and 23 deletions

View file

@ -374,6 +374,22 @@ options:
description: description:
- The list of scopes to be made available for this service account. - The list of scopes to be made available for this service account.
required: false required: false
status:
description:
- 'The status of the instance. One of the following values: PROVISIONING, STAGING,
RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.'
- As a user, use RUNNING to keep a machine "on" and TERMINATED to turn a machine
off .
required: false
version_added: 2.8
choices:
- PROVISIONING
- STAGING
- RUNNING
- STOPPING
- SUSPENDING
- SUSPENDED
- TERMINATED
tags: tags:
description: description:
- A list of tags to apply to this instance. Tags are used to identify valid sources - A list of tags to apply to this instance. Tags are used to identify valid sources
@ -816,6 +832,8 @@ status:
description: description:
- 'The status of the instance. One of the following values: PROVISIONING, STAGING, - 'The status of the instance. One of the following values: PROVISIONING, STAGING,
RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.' RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.'
- As a user, use RUNNING to keep a machine "on" and TERMINATED to turn a machine
off .
returned: success returned: success
type: str type: str
statusMessage: statusMessage:
@ -905,30 +923,36 @@ def main():
machine_type=dict(type='str'), machine_type=dict(type='str'),
min_cpu_platform=dict(type='str'), min_cpu_platform=dict(type='str'),
name=dict(type='str'), name=dict(type='str'),
network_interfaces=dict( network_interfaces=dict(type='list', elements='dict', options=dict(
type='list', access_configs=dict(type='list', elements='dict', options=dict(
elements='dict', name=dict(required=True, type='str'),
options=dict( nat_ip=dict(type='dict'),
access_configs=dict( type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])
type='list', )),
elements='dict', alias_ip_ranges=dict(type='list', elements='dict', options=dict(
options=dict( ip_cidr_range=dict(type='str'),
name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT']) subnetwork_range_name=dict(type='str')
), )),
), name=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'),
network=dict(type='dict'), network_ip=dict(type='str'),
network_ip=dict(type='str'), subnetwork=dict(type='dict')
subnetwork=dict(type='dict'), )),
), scheduling=dict(type='dict', options=dict(
), automatic_restart=dict(type='bool'),
scheduling=dict( on_host_maintenance=dict(type='str'),
type='dict', options=dict(automatic_restart=dict(type='bool'), on_host_maintenance=dict(type='str'), preemptible=dict(type='bool')) preemptible=dict(type='bool')
), )),
service_accounts=dict(type='list', elements='dict', options=dict(email=dict(type='str'), scopes=dict(type='list', elements='str'))), service_accounts=dict(type='list', elements='dict', options=dict(
email=dict(type='str'),
scopes=dict(type='list', elements='str')
)),
status=dict(type='str', choices=['PROVISIONING', 'STAGING', 'RUNNING', 'STOPPING', 'SUSPENDING', 'SUSPENDED', 'TERMINATED']), status=dict(type='str', choices=['PROVISIONING', 'STAGING', 'RUNNING', 'STOPPING', 'SUSPENDING', 'SUSPENDED', 'TERMINATED']),
tags=dict(type='dict', options=dict(fingerprint=dict(type='str'), items=dict(type='list', elements='str'))), tags=dict(type='dict', options=dict(
zone=dict(required=True, type='str'), fingerprint=dict(type='str'),
items=dict(type='list', elements='str')
)),
zone=dict(required=True, type='str')
) )
) )
@ -1016,6 +1040,7 @@ def resource_to_request(module):
u'networkInterfaces': InstanceNetworkinterfacesArray(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'scheduling': InstanceScheduling(module.params.get('scheduling', {}), module).to_request(),
u'serviceAccounts': InstanceServiceaccountsArray(module.params.get('service_accounts', []), module).to_request(), u'serviceAccounts': InstanceServiceaccountsArray(module.params.get('service_accounts', []), module).to_request(),
u'status': module.params.get('status'),
u'tags': InstanceTags(module.params.get('tags', {}), module).to_request() u'tags': InstanceTags(module.params.get('tags', {}), module).to_request()
} }
request = encode_request(request, module) request = encode_request(request, module)

View file

@ -431,6 +431,8 @@ items:
description: description:
- 'The status of the instance. One of the following values: PROVISIONING, STAGING, - 'The status of the instance. One of the following values: PROVISIONING, STAGING,
RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.' RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.'
- As a user, use RUNNING to keep a machine "on" and TERMINATED to turn a machine
off .
returned: success returned: success
type: str type: str
statusMessage: statusMessage: