pureport.pureport.pureport_port_facts (0.0.9) — module

Retrieve a list of ports for an account

| "added in version" 2.8 of pureport.pureport"

Authors: Matt Traynham (@mtraynham)

preview | supported by Pureport

Install collection

Install with ansible-galaxy collection install pureport.pureport:==0.0.9


Add to requirements.yml

  collections:
    - name: pureport.pureport
      version: 0.0.9

Description

Retrieve a list of ports for an account


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List ports for an account
  ports_info:
    api_key: XXXXXXXXXXXXX
    api_secret: XXXXXXXXXXXXXXXXX
    account_href: /accounts/ac-XXXXXXXXXXXXXXXXXXXXXX
  register: result   # Registers result.ports
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Display all connection hrefs using a json_query filter
  debug:
    var: item
  loop: "{{ result.connections | json_query('[*].href') }}"

Inputs

    
api_key:
    description:
    - The pre-configured API Key for a Pureport Account.
    - Users should provide either the 'api_key' and 'api_secret' or the obtained 'api_access_token'.
    required: false
    type: str

api_secret:
    description:
    - The pre-configured API Secret for a Pureport Account.
    - Users should provide either the 'api_key' and 'api_secret' or the obtained 'api_access_token'.
    required: false
    type: str

account_href:
    description:
    - The Pureport Account object.
    - This should be the full 'href' path to the Account ReST object (e.g /accounts/abc).
    required: true
    type: str

api_base_url:
    description:
    - The host url for the Pureport API.
    required: false
    type: str

api_access_token:
    description:
    - The access token to use with Pureport API.  This can be obtained from
    - the `pureport_access_token_fact` module.
    - Users should provide either the 'api_key' and 'api_secret' or the obtained 'api_access_token'.
    type: str

Outputs

ports:
  contains:
    account:
      contains:
        href:
          description:
          - The account href
          returned: success
          sample: /accounts/ac-XXXXXXXXXXXXXXXXXXXXXX
          type: str
        id:
          description:
          - The account id
          returned: success
          sample: ac-XXXXXXXXXXXXXXXXXXXXXX
          type: str
        title:
          description:
          - The account title
          returned: success
          sample: My Account
          type: str
      description:
      - The account this port is tied to.
      returned: success
      type: complex
    availability_domain:
      description:
      - The availability domain of the port.
      returned: success
      sample: PRIMARY
      type: str
    billing_term:
      description:
      - The billing term of the port.
      returned: success
      sample: MONTHLY
      type: str
    description:
      description:
      - The description of the port.
      returned: success
      sample: My port description
      type: str
    facility:
      contains:
        href:
          description:
          - The facility href
          returned: success
          sample: /facilities/fac-XXXXXXXXXXXXXXXXXXXXXX
          type: str
        id:
          description:
          - The facility id
          returned: success
          sample: fac-XXXXXXXXXXXXXXXXXXXXXX
          type: str
        title:
          description:
          - The facility title
          returned: success
          sample: My Facility
          type: str
      description:
      - The facility this port is tied to.
      returned: success
      type: complex
    href:
      description:
      - The port href, a path to resource on the server.
      returned: success
      sample: /ports/port-rfqj4qc9fO8hDOczEB7Z_Q
      type: str
    id:
      description:
      - The port id.
      returned: success
      sample: port-rfqj4qc9fO8hDOczEB7Z_Q
      type: str
    media_type:
      description:
      - The media type of the port.
      returned: success
      sample: LX
      type: str
    name:
      description:
      - The name of the port.
      returned: success
      sample: My Port Name
      type: str
    provider:
      description:
      - The port provider
      returned: success
      sample: PACKET_FABRIC
      type: str
    speed:
      description:
      - The speed of the port.
      returned: success
      sample: 1000
      type: int
    state:
      description:
      - The state of the port.
      returned: success
      sample: REQUESTED
      type: str
  description: a list of Port (dict) objects
  type: complex