Promote field compute_instance.scheduling.min_node_cpus and related fields to ga (#4593) (#388)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2021-03-15 16:00:59 -07:00 committed by GitHub
parent 7b440267f3
commit dbd5dbc2fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 151 additions and 47 deletions

View file

@ -217,7 +217,7 @@ options:
kms_key_service_account: kms_key_service_account:
description: description:
- The service account used for the encryption request for the given KMS key. - The service account used for the encryption request for the given KMS key.
If absent, the Compute Engine Service Agent service account is used. - If absent, the Compute Engine Service Agent service account is used.
required: false required: false
type: str type: str
project: project:
@ -501,7 +501,7 @@ sourceSnapshotEncryptionKey:
kmsKeyServiceAccount: kmsKeyServiceAccount:
description: description:
- The service account used for the encryption request for the given KMS key. - The service account used for the encryption request for the given KMS key.
If absent, the Compute Engine Service Agent service account is used. - If absent, the Compute Engine Service Agent service account is used.
returned: success returned: success
type: str type: str
sourceSnapshotId: sourceSnapshotId:

View file

@ -336,7 +336,8 @@ resources:
kmsKeyServiceAccount: kmsKeyServiceAccount:
description: description:
- The service account used for the encryption request for the given KMS - The service account used for the encryption request for the given KMS
key. If absent, the Compute Engine Service Agent service account is used. key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success returned: success
type: str type: str
sourceSnapshotId: sourceSnapshotId:

View file

@ -411,9 +411,9 @@ options:
suboptions: suboptions:
port: port:
description: description:
- The port number for the health check request. Must be specified if portName - The port number for the health check request.
and portSpecification are not set or if port_specification is USE_FIXED_PORT. - Must be specified if portName and portSpecification are not set or if port_specification
Valid values are 1 through 65535. is USE_FIXED_PORT. Valid values are 1 through 65535.
required: false required: false
type: int type: int
port_name: port_name:
@ -438,9 +438,9 @@ options:
type: str type: str
grpc_service_name: grpc_service_name:
description: description:
- 'The gRPC service name for the health check. The value of grpcServiceName - The gRPC service name for the health check.
has the following meanings by convention: - Empty serviceName means the - 'The value of grpcServiceName has the following meanings by convention:
overall status of all services at the backend.' - Empty serviceName means the overall status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined - "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service." by the owner of the service."
- The grpcServiceName can only be ASCII. - The grpcServiceName can only be ASCII.
@ -846,9 +846,9 @@ grpcHealthCheck:
contains: contains:
port: port:
description: description:
- The port number for the health check request. Must be specified if portName - The port number for the health check request.
and portSpecification are not set or if port_specification is USE_FIXED_PORT. - Must be specified if portName and portSpecification are not set or if port_specification
Valid values are 1 through 65535. is USE_FIXED_PORT. Valid values are 1 through 65535.
returned: success returned: success
type: int type: int
portName: portName:
@ -871,9 +871,9 @@ grpcHealthCheck:
type: str type: str
grpcServiceName: grpcServiceName:
description: description:
- 'The gRPC service name for the health check. The value of grpcServiceName - The gRPC service name for the health check.
has the following meanings by convention: - Empty serviceName means the overall - 'The value of grpcServiceName has the following meanings by convention: -
status of all services at the backend.' Empty serviceName means the overall status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined - "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service." by the owner of the service."
- The grpcServiceName can only be ASCII. - The grpcServiceName can only be ASCII.

View file

@ -459,9 +459,9 @@ resources:
contains: contains:
port: port:
description: description:
- The port number for the health check request. Must be specified if portName - The port number for the health check request.
and portSpecification are not set or if port_specification is USE_FIXED_PORT. - Must be specified if portName and portSpecification are not set or if
Valid values are 1 through 65535. port_specification is USE_FIXED_PORT. Valid values are 1 through 65535.
returned: success returned: success
type: int type: int
portName: portName:
@ -486,9 +486,9 @@ resources:
type: str type: str
grpcServiceName: grpcServiceName:
description: description:
- 'The gRPC service name for the health check. The value of grpcServiceName - The gRPC service name for the health check.
has the following meanings by convention: - Empty serviceName means the - 'The value of grpcServiceName has the following meanings by convention:
overall status of all services at the backend.' - Empty serviceName means the overall status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined - "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service." by the owner of the service."
- The grpcServiceName can only be ASCII. - The grpcServiceName can only be ASCII.

View file

@ -88,6 +88,35 @@ options:
- Physical memory available to the node, defined in MB. - Physical memory available to the node, defined in MB.
required: false required: false
type: str type: str
server_binding:
description:
- The server binding policy for nodes using this template. Determines where the
nodes should restart following a maintenance event.
required: false
type: dict
suboptions:
type:
description:
- Type of server binding policy. If `RESTART_NODE_ON_ANY_SERVER`, nodes using
this template will restart on any physical server following a maintenance
event.
- If `RESTART_NODE_ON_MINIMAL_SERVER`, nodes using this template will restart
on the same physical server following a maintenance event, instead of being
live migrated to or restarted on a new physical server. This option may
be useful if you are using software licenses tied to the underlying server
characteristics such as physical sockets or cores, to avoid the need for
additional licenses when maintenance occurs. However, VMs on such nodes
will experience outages while maintenance is applied.
- 'Some valid choices include: "RESTART_NODE_ON_ANY_SERVER", "RESTART_NODE_ON_MINIMAL_SERVERS"'
required: true
type: str
cpu_overcommit_type:
description:
- CPU overcommit.
- 'Some valid choices include: "ENABLED", "NONE"'
required: false
default: NONE
type: str
region: region:
description: description:
- Region where nodes using the node template will be created . - Region where nodes using the node template will be created .
@ -208,6 +237,32 @@ nodeTypeFlexibility:
- Use local SSD . - Use local SSD .
returned: success returned: success
type: str type: str
serverBinding:
description:
- The server binding policy for nodes using this template. Determines where the
nodes should restart following a maintenance event.
returned: success
type: complex
contains:
type:
description:
- Type of server binding policy. If `RESTART_NODE_ON_ANY_SERVER`, nodes using
this template will restart on any physical server following a maintenance
event.
- If `RESTART_NODE_ON_MINIMAL_SERVER`, nodes using this template will restart
on the same physical server following a maintenance event, instead of being
live migrated to or restarted on a new physical server. This option may be
useful if you are using software licenses tied to the underlying server characteristics
such as physical sockets or cores, to avoid the need for additional licenses
when maintenance occurs. However, VMs on such nodes will experience outages
while maintenance is applied.
returned: success
type: str
cpuOvercommitType:
description:
- CPU overcommit.
returned: success
type: str
region: region:
description: description:
- Region where nodes using the node template will be created . - Region where nodes using the node template will be created .
@ -247,6 +302,8 @@ def main():
node_affinity_labels=dict(type='dict'), node_affinity_labels=dict(type='dict'),
node_type=dict(type='str'), node_type=dict(type='str'),
node_type_flexibility=dict(type='dict', options=dict(cpus=dict(type='str'), memory=dict(type='str'))), node_type_flexibility=dict(type='dict', options=dict(cpus=dict(type='str'), memory=dict(type='str'))),
server_binding=dict(type='dict', options=dict(type=dict(required=True, type='str'))),
cpu_overcommit_type=dict(default='NONE', type='str'),
region=dict(required=True, type='str'), region=dict(required=True, type='str'),
), ),
mutually_exclusive=[['node_type', 'node_type_flexibility']], mutually_exclusive=[['node_type', 'node_type_flexibility']],
@ -306,6 +363,8 @@ def resource_to_request(module):
u'nodeAffinityLabels': module.params.get('node_affinity_labels'), u'nodeAffinityLabels': module.params.get('node_affinity_labels'),
u'nodeType': module.params.get('node_type'), u'nodeType': module.params.get('node_type'),
u'nodeTypeFlexibility': NodeTemplateNodetypeflexibility(module.params.get('node_type_flexibility', {}), module).to_request(), u'nodeTypeFlexibility': NodeTemplateNodetypeflexibility(module.params.get('node_type_flexibility', {}), module).to_request(),
u'serverBinding': NodeTemplateServerbinding(module.params.get('server_binding', {}), module).to_request(),
u'cpuOvercommitType': module.params.get('cpu_overcommit_type'),
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -377,6 +436,8 @@ def response_to_hash(module, response):
u'nodeAffinityLabels': response.get(u'nodeAffinityLabels'), u'nodeAffinityLabels': response.get(u'nodeAffinityLabels'),
u'nodeType': response.get(u'nodeType'), u'nodeType': response.get(u'nodeType'),
u'nodeTypeFlexibility': NodeTemplateNodetypeflexibility(response.get(u'nodeTypeFlexibility', {}), module).from_response(), u'nodeTypeFlexibility': NodeTemplateNodetypeflexibility(response.get(u'nodeTypeFlexibility', {}), module).from_response(),
u'serverBinding': NodeTemplateServerbinding(response.get(u'serverBinding', {}), module).from_response(),
u'cpuOvercommitType': response.get(u'cpuOvercommitType'),
} }
@ -439,5 +500,20 @@ class NodeTemplateNodetypeflexibility(object):
return remove_nones_from_dict({u'cpus': self.request.get(u'cpus'), u'memory': self.request.get(u'memory')}) return remove_nones_from_dict({u'cpus': self.request.get(u'cpus'), u'memory': self.request.get(u'memory')})
class NodeTemplateServerbinding(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict({u'type': self.request.get('type')})
def from_response(self):
return remove_nones_from_dict({u'type': self.request.get(u'type')})
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -168,6 +168,32 @@ resources:
- Use local SSD . - Use local SSD .
returned: success returned: success
type: str type: str
serverBinding:
description:
- The server binding policy for nodes using this template. Determines where
the nodes should restart following a maintenance event.
returned: success
type: complex
contains:
type:
description:
- Type of server binding policy. If `RESTART_NODE_ON_ANY_SERVER`, nodes
using this template will restart on any physical server following a maintenance
event.
- If `RESTART_NODE_ON_MINIMAL_SERVER`, nodes using this template will restart
on the same physical server following a maintenance event, instead of
being live migrated to or restarted on a new physical server. This option
may be useful if you are using software licenses tied to the underlying
server characteristics such as physical sockets or cores, to avoid the
need for additional licenses when maintenance occurs. However, VMs on
such nodes will experience outages while maintenance is applied.
returned: success
type: str
cpuOvercommitType:
description:
- CPU overcommit.
returned: success
type: str
region: region:
description: description:
- Region where nodes using the node template will be created . - Region where nodes using the node template will be created .

View file

@ -403,9 +403,9 @@ options:
health_checks: health_checks:
description: description:
- The set of URLs to HealthCheck resources for health checking this RegionBackendService. - The set of URLs to HealthCheck resources for health checking this RegionBackendService.
Currently at most one health check can be specified. A health check must be Currently at most one health check can be specified.
specified unless the backend service uses an internet or serverless NEG as a - A health check must be specified unless the backend service uses an internet
backend. or serverless NEG as a backend.
elements: str elements: str
required: false required: false
type: list type: list
@ -1089,8 +1089,9 @@ fingerprint:
healthChecks: healthChecks:
description: description:
- The set of URLs to HealthCheck resources for health checking this RegionBackendService. - The set of URLs to HealthCheck resources for health checking this RegionBackendService.
Currently at most one health check can be specified. A health check must be specified Currently at most one health check can be specified.
unless the backend service uses an internet or serverless NEG as a backend. - A health check must be specified unless the backend service uses an internet or
serverless NEG as a backend.
returned: success returned: success
type: list type: list
id: id:

View file

@ -478,9 +478,9 @@ resources:
healthChecks: healthChecks:
description: description:
- The set of URLs to HealthCheck resources for health checking this RegionBackendService. - The set of URLs to HealthCheck resources for health checking this RegionBackendService.
Currently at most one health check can be specified. A health check must be Currently at most one health check can be specified.
specified unless the backend service uses an internet or serverless NEG as - A health check must be specified unless the backend service uses an internet
a backend. or serverless NEG as a backend.
returned: success returned: success
type: list type: list
id: id:

View file

@ -406,9 +406,9 @@ options:
suboptions: suboptions:
port: port:
description: description:
- The port number for the health check request. Must be specified if portName - The port number for the health check request.
and portSpecification are not set or if port_specification is USE_FIXED_PORT. - Must be specified if portName and portSpecification are not set or if port_specification
Valid values are 1 through 65535. is USE_FIXED_PORT. Valid values are 1 through 65535.
required: false required: false
type: int type: int
port_name: port_name:
@ -433,9 +433,9 @@ options:
type: str type: str
grpc_service_name: grpc_service_name:
description: description:
- 'The gRPC service name for the health check. The value of grpcServiceName - The gRPC service name for the health check.
has the following meanings by convention: * Empty serviceName means the - 'The value of grpcServiceName has the following meanings by convention:
overall status of all services at the backend.' * Empty serviceName means the overall status of all services at the backend.'
- "* Non-empty serviceName means the health of that gRPC service, as defined - "* Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service." by the owner of the service."
- The grpcServiceName can only be ASCII. - The grpcServiceName can only be ASCII.
@ -847,9 +847,9 @@ grpcHealthCheck:
contains: contains:
port: port:
description: description:
- The port number for the health check request. Must be specified if portName - The port number for the health check request.
and portSpecification are not set or if port_specification is USE_FIXED_PORT. - Must be specified if portName and portSpecification are not set or if port_specification
Valid values are 1 through 65535. is USE_FIXED_PORT. Valid values are 1 through 65535.
returned: success returned: success
type: int type: int
portName: portName:
@ -872,9 +872,9 @@ grpcHealthCheck:
type: str type: str
grpcServiceName: grpcServiceName:
description: description:
- 'The gRPC service name for the health check. The value of grpcServiceName - The gRPC service name for the health check.
has the following meanings by convention: * Empty serviceName means the overall - 'The value of grpcServiceName has the following meanings by convention: *
status of all services at the backend.' Empty serviceName means the overall status of all services at the backend.'
- "* Non-empty serviceName means the health of that gRPC service, as defined - "* Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service." by the owner of the service."
- The grpcServiceName can only be ASCII. - The grpcServiceName can only be ASCII.

View file

@ -465,9 +465,9 @@ resources:
contains: contains:
port: port:
description: description:
- The port number for the health check request. Must be specified if portName - The port number for the health check request.
and portSpecification are not set or if port_specification is USE_FIXED_PORT. - Must be specified if portName and portSpecification are not set or if
Valid values are 1 through 65535. port_specification is USE_FIXED_PORT. Valid values are 1 through 65535.
returned: success returned: success
type: int type: int
portName: portName:
@ -492,9 +492,9 @@ resources:
type: str type: str
grpcServiceName: grpcServiceName:
description: description:
- 'The gRPC service name for the health check. The value of grpcServiceName - The gRPC service name for the health check.
has the following meanings by convention: * Empty serviceName means the - 'The value of grpcServiceName has the following meanings by convention:
overall status of all services at the backend.' * Empty serviceName means the overall status of all services at the backend.'
- "* Non-empty serviceName means the health of that gRPC service, as defined - "* Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service." by the owner of the service."
- The grpcServiceName can only be ASCII. - The grpcServiceName can only be ASCII.