gcore.cloud.network_info (1.0.1) — module

Gather infos about all GCore networks.

Authors: GCore (@GCore)

Install collection

Install with ansible-galaxy collection install gcore.cloud:==1.0.1


Add to requirements.yml

  collections:
    - name: gcore.cloud
      version: 1.0.1

Description

Gather infos about all GCore networks.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather gcore networks info
  gcore.cloud.network_info:
    api_key: "{{ api_key }}"
    region_id: "{{ region_id }}"
    project_id: "{{ project_id }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather gcore specific network info
  gcore.cloud.network_info:
    api_key: "{{ api_key }}"
    region_id: "{{ region_id }}"
    project_id: "{{ project_id }}"
    network_id: "{{ network_id }}"

Inputs

    
limit:
    description:
    - Limit the number of returned limit request entities.
    required: false
    type: int

offset:
    description:
    - Offset value is used to exclude the first set of records from the result.
    required: false
    type: int

api_key:
    description:
    - GCore API auth key
    - Can be passed as I(CLOUD_API_KEY) environment variable.
    type: str

api_host:
    default: https://api.gcore.com/cloud
    description:
    - GCore API base host
    - Can be passed as I(CLOUD_API_HOST) environment variable.
    type: str

order_by:
    description:
    - Order networks by transmitted fields and directions (name.asc).
    required: false
    type: str

region_id:
    description:
    - GCore API region ID
    - Required if I(region_name) is not passed
    - Can be passed as I(CLOUD_REGION_ID) environment variable.
    type: int

metadata_k:
    description:
    - Filter by metadata keys. Must be a valid JSON string.
    required: false
    type: str

network_id:
    description:
    - The ID of network you want to get.
    - The module will fail if the provided ID is invalid.
    required: false
    type: str

project_id:
    description:
    - GCore API project ID
    - Required if I(project_name) is not passed
    - Can be passed as I(CLOUD_PROJECT_ID) environment variable.
    type: int

api_timeout:
    default: 30
    description:
    - Timeout in seconds to polling GCore API
    type: int

metadata_kv:
    description:
    - Filter by metadata key-value pairs. Must be a valid JSON string.
    required: false
    type: str

region_name:
    description:
    - GCore API region name
    - Required if I(region_id) is not passed
    - Can be passed as I(CLOUD_REGION_NAME) environment variable.
    type: str

project_name:
    description:
    - GCore API project name
    - Required if I(project_id) is not passed
    - Can be passed as I(CLOUD_PROJECT_NAME) environment variable.
    type: str

Outputs

network_info:
  contains:
    created_at:
      description: Datetime when the network was created
      returned: always
      sample: 2019-06-18T11:56:16+0000
      type: str
    creator_task_id:
      description: Task that created this entity
      returned: always
      sample: fd50fdd1-0482-4c9b-b847-fc9924665af6
      type: str
    default:
      description: True if the network has is_default attribute
      returned: if available
      sample: true
      type: bool
    external:
      description: True if the network has router:external attribute
      returned: always
      sample: true
      type: bool
    id:
      description: Network ID
      returned: always
      sample: 726ecfcc-7fd0-4e30-a86e-7892524aa483
      type: str
    metadata:
      description: Network metadata
      returned: if available
      sample:
      - key: key1
        read_only: false
        value: value1
      type: list
    mtu:
      description: Maximum transmission unit
      returned: always
      sample: 1450
      type: int
    name:
      description: Network name
      returned: always
      sample: 123
      type: str
    project_id:
      description: Project ID
      returned: always
      sample: 1
      type: int
    region:
      description: Region name
      returned: always
      sample: Luxembourg 1
      type: str
    region_id:
      description: Region ID
      returned: always
      sample: 1
      type: int
    segmentation_id:
      description: Id of network segment
      returned: if available
      sample: 9
      type: int
    shared:
      description: True when the network is shared with your project by external owner
      returned: always
      sample: false
      type: bool
    subnets:
      description: List of subnetworks
      elements: str
      returned: always
      sample:
      - f00624ab-41bc-4d54-a723-1673ce32d997
      - 41e0f698-4d39-483b-b77a-18eb070e4c09
      type: list
    task_id:
      description: Active task. If None, action has been performed immediately in
        the request itself
      returned: if available
      sample: f00624ab-41bc-4d54-a723-1673ce32d997
      type: str
    type:
      description: Network type (vlan, vxlan)
      returned: always
      sample: vlan
      type: str
    updated_at:
      description: Datetime when the network was last updated
      returned: if available
      sample: 2019-06-19T11:56:16+0000
      type: str
  description:
  - When I(network_id) is passed, it is a dict of resource.
  - Otherwise it is a list of dictionaries.
  returned: always
  type: complex

See also