netapp.storagegrid.na_sg_grid_traffic_classes (21.12.0) — module

Manage Traffic Classification Policy configuration on StorageGRID.

| "added in version" 21.10.0 of netapp.storagegrid"

Authors: NetApp Ansible Team (@joshedmonds) <ng-ansibleteam@netapp.com>

Install collection

Install with ansible-galaxy collection install netapp.storagegrid:==21.12.0


Add to requirements.yml

  collections:
    - name: netapp.storagegrid
      version: 21.12.0

Description

Create, Update, Delete Traffic Classification Policies on NetApp StorageGRID.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: create Traffic Classification Policy with bandwidth limit on buckets
    netapp.storagegrid.na_sg_grid_traffic_classes:
      api_url: "https://<storagegrid-endpoint-url>"
      auth_token: "storagegrid-auth-token"
      validate_certs: false
      state: present
      name: Traffic-Policy1
      matchers:
        - type: bucket
          members: bucket1,anotherbucket
      limits:
        - type: aggregateBandwidthOut
          value: 100000000
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: create Traffic Classification Policy with bandwidth limits except for specific tenant account
    netapp.storagegrid.na_sg_grid_traffic_classes:
      api_url: "https://<storagegrid-endpoint-url>"
      auth_token: "storagegrid-auth-token"
      validate_certs: false
      state: present
      name: Fabricpool-Policy
      description: "Limit all to 500MB/s except FabricPool tenant"
      matchers:
        - type: tenant
          inverse: True
          members: 12345678901234567890
      limits:
        - type: aggregateBandwidthIn
          value: 50000000
        - type: aggregateBandwidthOut
          value: 50000000
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: rename Traffic Classification Policy
    netapp.storagegrid.na_sg_grid_traffic_classes:
      api_url: "https://<storagegrid-endpoint-url>"
      auth_token: "storagegrid-auth-token"
      validate_certs: false
      state: present
      policy_id: 00000000-0000-0000-0000-000000000000
      name: Traffic-Policy1-New-Name
      matchers:
        - type: bucket
          members: bucket1,anotherbucket
      limits:
        - type: aggregateBandwidthOut
          value: 100000000
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: delete Traffic Classification Policy
    netapp.storagegrid.na_sg_grid_traffic_classes:
      api_url: "https://<storagegrid-endpoint-url>"
      auth_token: "storagegrid-auth-token"
      validate_certs: false
      state: absent
      name: Traffic-Policy1

Inputs

    
name:
    description:
    - Name of the Traffic Classification Policy.
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the specified Traffic Classification Policy should exist.
    type: str

limits:
    description:
    - Optional limits to impose on client requests matched by this traffic class.
    - Only one of each limit type can be specified.
    elements: dict
    suboptions:
      type:
        choices:
        - aggregateBandwidthIn
        - aggregateBandwidthOut
        - concurrentReadRequests
        - concurrentWriteRequests
        - readRequestRate
        - writeRequestRate
        - perRequestBandwidthIn
        - perRequestBandwidthOut
        description:
        - The type of limit to apply.
        - C(aggregateBandwidthIn) - The maximum combined upload bandwidth in bytes/second
          of all concurrent requests that match this policy.
        - C(aggregateBandwidthOut) - The maximum combined download bandwidth in bytes/second
          of all concurrent requests that match this policy.
        - C(concurrentReadRequests) - The maximum number of download requests that can
          be in progress at the same time.
        - C(concurrentWriteRequests) - The maximum number of upload requests that can
          be in progress at the same time.
        - C(readRequestRate) - The maximum number of download requests that can be started
          each second.
        - C(writeRequestRate) - The maximum number of download requests that can be started
          each second.
        - C(perRequestBandwidthIn) - The maximum upload bandwidth in bytes/second allowed
          for each request that matches this policy.
        - C(perRequestBandwidthOut) - The maximum download bandwidth in bytes/second allowed
          for each request that matches this policy.
        required: true
        type: str
      value:
        description:
        - The limit to apply.
        - Limit values are type specific.
        required: true
        type: int
    type: list

api_url:
    description:
    - The url to the StorageGRID Admin Node REST API.
    required: true
    type: str

matchers:
    description:
    - A set of parameters to match.
    - The traffic class will match requests where any of these matchers match.
    elements: dict
    suboptions:
      inverse:
        default: false
        description:
        - If I(true), entities that match the value are excluded.
        type: bool
      members:
        description:
        - A list of members to match on.
        elements: str
        required: true
        type: list
      type:
        choices:
        - bucket
        - bucket-regex
        - cidr
        - endpoint
        - tenant
        description:
        - The attribute of the request to match.
        - C(bucket) - The S3 bucket (or Swift container) being accessed.
        - C(bucket-regex) - A regular expression to evaluate against the S3 bucket (or
          Swift container) being accessed.
        - C(cidr) - Matches if the client request source IP is in the specified IPv4 CIDR
          (RFC4632).
        - C(tenant) - Matches if the S3 bucket (or Swift container) is owned by the tenant
          account with this ID.
        required: true
        type: str
    type: list

policy_id:
    description:
    - Traffic Classification Policy ID.
    - May be used for modify or delete operation.
    type: str

auth_token:
    description:
    - The authorization token for the API request
    required: true
    type: str

description:
    description:
    - Description of the Traffic Classification Policy.
    type: str

validate_certs:
    default: true
    description:
    - Should https certificates be validated?
    required: false
    type: bool

Outputs

resp:
  description: Returns information about the StorageGRID Traffic Classification Policy.
  returned: success
  sample:
    description: Traffic Classification Policy 1
    id: 6b2946e6-7fed-40d0-9262-8e922580aba7
    limits:
    - type: aggregateBandwidthOut
      value: 100000000
    matchers:
    - inverse: false
      members:
      - 192.168.50.0/24
      type: cidr
    - inverse: false
      members:
      - mybucket1
      - mybucket2
      type: bucket
    name: Traffic-Policy1
  type: dict