# Copyright (c) IBM Corporation 2020,2021

DOCUMENTATION = r"""
role: sa_create_dynamic_resource
short_description: Role creates and resumes a dynamic resource
description:
  The B(IBM Z System Automation collection) provides an Ansible role, referred to as B(sa_create_dynamic_resource), to create
  and resume a new L(dynamic resource,https://www.ibm.com/support/knowledgecenter/de/SSWRCJ_4.2.0/com.ibm.safos.doc_4.2/UserGuide/Dynamic_Resources.html#concept_kmr_r4p_4jb) instance from a template.
author: "Anke Luedde (@lueddea)"
options:
  sa_service_hostname:
    description:
      - Specifies the IBM Z System Automation Operations REST server host name.
    type: str
    required: True
  sa_service_port:
    description:
      - Specifies the port to which the IBM Z Automation Operations REST service is bound.
    type: str
    required: True
  sa_service_protocol:
    description:
      - Specifies the protocol that is configured for the IBM Z Automation Operations REST server.
    type: str
    required: True
    default: HTTPS
  sa_rest_api_timeout:
    description:
      - Specifies the socket level timeout for the REST API call in seconds.
    type: int
    required: False
    default: 30
  username:
    description:
      - Specifies the NetView user.
    type: str
    required: True
  password:
    description:
      - Specifies the password for above user.
    type: str
    required: True	  
  templateName:
    description:  
      - Specifies the name of the template that will be used to create the dynamic resource.
    type: str
    required: True  
  subsystem:
    description:
      - Specifies the subsystem name of the new resource.
      - The maximum length for this value is 11.
    type: str
    required: True	  
  system:
    description:
      - Specifies the system where the resource will be created.
      - The maximum length for this value is 8.
    type: str
    required: True	  
  job:
    description:
      - Specifies the job name of the new resource.
      - The maximum length for this value is 8.
    type: str
    required: True	  
  procedure:
    description:
      - Specifies the procedure name used by the new resource.
      - The maximum length for this value is 8.
    type: str
    required: False	  
  comment:
    description: 
      - Specifies a comment to be associated with the creation of the new resource.
      - The maximum length for this value is 40.
    type: str
    required: False	  
  group:
    description:
      - Specifies the automation name of the application group (APG) that will host the new resource.
      - The maximum length for this value is 11.
    type: str
    required: False	  
  sdesc:
    description:
      - Specifies a short description of the new resource.
      - The maximum length for this value is 40.
    type: str
    required: False	  
notes:
    - The given example assumes that you have an inventory file I(hosts) and host vars I(sampleHost.yaml) with appropriate values
      to identify the target IBM Z System Automation Operations REST server end points.
    - Also a I(vars.yaml) which stores the required values for the dynamic resource that you want to create is required.
"""

EXAMPLES = r"""
- name: create and resume a dynamic resource in SA
  hosts: sampleHost
  gather_facts: no
  collections:
    - ibm.ibm_zos_sysauto
  vars_files:
    - vars.yaml
  vars_prompt:
    - name: username
      prompt: "Enter your username"
      private: no
    - name: password
      prompt: "Enter your password"
      private: yes
  tasks:
    - include_role:
        name: sa_create_dynamic_resource
"""

# Roles don't return anything, this RETURN block must be defined and remain
# empty for doc extraction tooling to avoid an error.
RETURN = r"""
 """
