phoenixnap.bmc.product_info (1.17.0) — module

Gather information about phoenixNAP BMC products

| "added in version" 1.3.0 of phoenixnap.bmc"

Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com>

preview | supported by certified

Install collection

Install with ansible-galaxy collection install phoenixnap.bmc:==1.17.0


Add to requirements.yml

  collections:
    - name: phoenixnap.bmc
      version: 1.17.0

Description

Gather information about products.

This module has a dependency on requests

API is documented at U(https://developers.phoenixnap.com/docs/bmc-billing/1/routes/products/get).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# All the examples assume that you have file config.yaml with your 'clientId' and 'clientSecret'
# in location: ~/.pnap/config.yaml

- name: Information about all products
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Information about all products
      phoenixnap.bmc.product_info:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
      register: output
    - name: Print the gathered infos
      ansible.builtin.debug:
        var: output.products
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Information about all server products at the Phoenix location
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Information about all server products at a specific location
      phoenixnap.bmc.product_info:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        product_category: SERVER
        location: PHX
      register: output
    - name: Print the gathered infos
      ansible.builtin.debug:
        var: output.products

Inputs

    
location:
    description: Location.
    type: str

sku_code:
    description: Sku code.
    type: str

client_id:
    description: Client ID (Application Management)
    type: str

product_code:
    description: Product code.
    type: str

client_secret:
    description: Client Secret (Application Management)
    type: str

product_category:
    description: Product category.
    type: str

Outputs

products:
  contains:
    metadata:
      contains:
        coresPerCpu:
          description: CPU frequency in GHz.
          sample: 2
          type: int
        cpu:
          description: CPU name.
          sample: Dual Gold 6258R
          type: str
        cpuCount:
          description: Number of CPUs.
          sample: 56
          type: int
        cpuFrequency:
          description: CPU frequency in GHz.
          sample: 0.22
          type: float
        network:
          description: Server network.
          sample: 2x 25Gbps
          type: str
        ramInGb:
          description: RAM in GB.
          sample: 256
          type: int
        storage:
          description: Server storage.
          sample: 2x 2TB NVMe
          type: str
      description: Details of the server product.
      type: list
    plans:
      contains:
        correlatedProductCode:
          description: Product code of the product this product is correlated with.
          sample: d1.tiny
          type: str
        location:
          description: The code identifying the location.
          sample: PHX
          type: str
        packageQuantity:
          description: Package size per month.
          sample: 50
          type: int
        packageUnit:
          description: Package size unit.
          sample: GB
          type: str
        price:
          description: The SKU identifying this pricing plan.
          sample: 0.22
          type: float
        priceUnit:
          description: The unit to which the price applies.
          sample: MONTH
          type: str
        pricingModel:
          description: The pricing model.
          sample: HOURLY
          type: str
        sku:
          description: The SKU identifying this pricing plan.
          sample: XXX-XXX-XXX
          type: str
        skuDescription:
          description: Description of this pricing plan.
          sample: Hourly Rate for d1.tiny in Phoenix
          type: str
      description: The pricing plans available for this product.
      returned: always
      type: list
    productCategory:
      description: The product category.
      returned: always
      sample: server
      type: str
    productCode:
      description: The code identifying the product. This code has significant across
        all locations.
      returned: always
      sample: d1.tiny
      type: str
  description: The products information as list
  returned: success
  type: list