ebuildy.cidre.api (0.12.1) — module

Helper to call JSON HTTP API

Authors: Thomas Decaux (@ebuildy)

Install collection

Install with ansible-galaxy collection install ebuildy.cidre:==0.12.1


Add to requirements.yml

  collections:
    - name: ebuildy.cidre
      version: 0.12.1

Description

Helper to call JSON HTTP API, such as Github or Gitlab HTTP API


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Search a milestone
  ebuildy.cidre.api:
    platform: gitlab
    resource: milestones
    action: get
    context:
      project: 12
    query_string:
        title: "{{ project.version_wanted }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create an issue
  ebuildy.cidre.api:
    platform: gitlab
    resource: issues
    action: create
    context:
      project: 12
    data:
        title: "Just a text"
        description: "Ok I am a test"
        milestone_id: 1

Inputs

    
api:
    choices:
    - github
    - gitlab
    - bitbucket
    - jira
    - confluence
    description:
    - gitlab / github / jira
    type: str

data:
    description:
    - Data to send as JSON body
    type: raw

repo:
    description: repo name or numerical ID
    type: string

action:
    choices:
    - get
    - update
    - delete
    - create
    default: get
    description:
    - HTTP method
    type: str

api_url:
    description: API endpoint
    type: string

context:
    description:
    - Related project / user / issue / milestone ID
    type: raw

resource:
    description:
    - Query string
    type: str

api_token:
    description: access_token
    type: string

body_format:
    default: json
    type: str

query_string:
    description:
    - Data to send as JSON body
    type: raw

Outputs

result:
  description:
  - The platform API response.
  returned: success
  type: complex