instance_group#

State module for managing InstanceGroups.

async idem_gcp.states.gcp.compute.instance_group.present(hub, ctx, name: str, zone: str = None, project: str = None, description: str = None, fingerprint: str = None, subnetwork: str = None, network: str = None, named_ports: List[NamedPort] = None, request_id: str = None, resource_id: str = None) Dict[str, Any][source]#

Create or update an instance group.

Creates an instance group in the specified project using the parameters that are included in the request.

Parameters:
  • name (str) – An Idem name of the resource.

  • description (str, Optional) – An optional description of this resource. Provide this property when you create the resource. Defaults to None.

  • zone (str) – The name of the zone where the instance group is located.

  • fingerprint (str, Optional) – The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. Defaults to None.

  • network (str, Optional) – The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). Defaults to None.

  • subnetwork (str, Optional) – The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). Defaults to None.

  • named_ports (List[Dict[str, Any]], Optional) –

    Assigns a name to a port number. For example: {name: “http”, port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: “app1”, port: 8080}, {name: “app1”, port: 8081}, {name: “app2”, port: 8082}] Named ports apply to all instances in this instance group. . Defaults to None.
    • name(str, Optional):

      The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.

    • port(int, Optional):

      The port number, which can be a value between 1 and 65535.

  • project (str) – Project ID for this request.

  • request_id (str, Optional) – An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). Defaults to None.

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

Returns:

Dict[str, Any]

Examples

resource_is_present:
  gcp.compute.instance_groups.present:
    - name: value
    - zone: value
    - project: value
    - instance_group: value
async idem_gcp.states.gcp.compute.instance_group.absent(hub, ctx, name: str, project: str = None, zone: str = None, request_id: str = None, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified instance group.

The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.

Parameters:
  • name (str) – An Idem name of the resource.

  • project (str) – Project ID for this request.

  • request_id (str, Optional) – An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). Defaults to None.

  • zone (str) – The name of the zone where the instance group is located.

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

Returns:

Dict[str, Any]

Examples

resource_is_absent:
  gcp.compute.instance_groups.absent:
    - name: value
    - project: value
    - instance_group: value
    - zone: value
async idem_gcp.states.gcp.compute.instance_group.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

Retrieves the list of zonal instance group resources contained within the specified zone. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead.

Returns:

Dict[str, Any]

Examples

$ idem describe gcp.compute.instance_groups
idem_gcp.states.gcp.compute.instance_group.is_pending(hub, ret: dict, state: str = None, **pending_kwargs) bool[source]#

Default implemented for each module.