Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/web_infrastructure/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pyo

�
�Udac@`stddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	Z	dd
l
Z
dd
lZddlm
Z
mZddlmZdd
lmZd
d
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zeddddgdddgdgddgd dgd!d"d#d$g�Zd%�Z e!d&krpe �nd
S('i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysQ

module: jira
version_added: "1.6"
short_description: create and modify issues in a JIRA instance
description:
  - Create and modify issues in a JIRA instance.

options:
  uri:
    required: true
    description:
      - Base URI for the JIRA instance.

  operation:
    required: true
    aliases: [ command ]
    choices: [ create, comment, edit, fetch, transition , link ]
    description:
      - The operation to perform.

  username:
    required: true
    description:
      - The username to log-in with.

  password:
    required: true
    description:
      - The password to log-in with.

  project:
    required: false
    description:
      - The project for this operation. Required for issue creation.

  summary:
    required: false
    description:
     - The issue summary, where appropriate.

  description:
    required: false
    description:
     - The issue description, where appropriate.

  issuetype:
    required: false
    description:
     - The issue type, for issue creation.

  issue:
    required: false
    description:
     - An existing issue key to operate on.

  comment:
    required: false
    description:
     - The comment text to add.

  status:
    required: false
    description:
     - The desired status; only relevant for the transition operation.

  assignee:
    required: false
    description:
     - Sets the assignee on create or transition operations. Note not all transitions will allow this.

  linktype:
    required: false
    version_added: 2.3
    description:
     - Set type of link, when action 'link' selected.

  inwardissue:
    required: false
    version_added: 2.3
    description:
     - Set issue from which link will be created.

  outwardissue:
    required: false
    version_added: 2.3
    description:
     - Set issue to which link will be created.

  fields:
    required: false
    description:
     - This is a free-form data structure that can contain arbitrary data. This is passed directly to the JIRA REST API
       (possibly after merging with other required data, as when passed to create). See examples for more information,
       and the JIRA REST API for the structure required for various fields.

  timeout:
    required: false
    version_added: 2.3
    description:
      - Set timeout, in seconds, on requests to JIRA API.
    default: 10

  validate_certs:
    required: false
    version_added: 2.5
    description:
      - Require valid SSL certificates (set to `false` if you'd like to use self-signed certificates)
    default: true
    type: bool

notes:
  - "Currently this only works with basic-auth."

author: "Steve Smith (@tarka)"
s'	
# Create a new issue and add a comment to it:
- name: Create an issue
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    project: ANS
    operation: create
    summary: Example Issue
    description: Created using Ansible
    issuetype: Task
  register: issue

- name: Comment on issue
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    issue: '{{ issue.meta.key }}'
    operation: comment
    comment: A comment added by Ansible

# Assign an existing issue using edit
- name: Assign an issue using free-form fields
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    issue: '{{ issue.meta.key}}'
    operation: edit
    assignee: ssmith

# Create an issue with an existing assignee
- name: Create an assigned issue
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    project: ANS
    operation: create
    summary: Assigned issue
    description: Created and assigned using Ansible
    issuetype: Task
    assignee: ssmith

# Edit an issue
- name: Set the labels on an issue using free-form fields
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    issue: '{{ issue.meta.key }}'
    operation: edit
  args:
    fields:
        labels:
          - autocreated
          - ansible

# Retrieve metadata for an issue and use it to create an account
- name: Get an issue
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    project: ANS
    operation: fetch
    issue: ANS-63
  register: issue

- name: Create a unix account for the reporter
  become: true
  user:
    name: '{{ issue.meta.fields.creator.name }}'
    comment: '{{ issue.meta.fields.creator.displayName }}'

# You can get list of valid linktypes at /rest/api/2/issueLinkType
# url of your jira installation.
- name: Create link from HSP-1 to MKY-1
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    operation: link
    linktype: Relates
    inwardissue: HSP-1
    outwardissue: MKY-1

# Transition an issue by target status
- name: Close the issue
  jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    issue: '{{ issue.meta.key }}'
    operation: transition
    status: Done
N(tto_texttto_bytes(t
AnsibleModule(t	fetch_urlc

C`s�|rtj|�}nttjtdj||�dd���}tt|d|d|d|didd	6d
|d6�\}}|ddkr�tj	d|d�n|j
�}	|	r�tjt|	dd��SiSdS(Ns{0}:{1}terrorstsurrogate_or_stricttdatatmethodttimeouttheaderssapplication/jsonsContent-TypesBasic %st
AuthorizationRi�i�i�tmsg(i�i�i�(tjsontdumpsRtbase64t	b64encodeR	tformatRtmodulet	fail_jsontreadtloads(
turltusertpasswdRRRtauthtresponsetinfotbody((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytrequest�s	-
c	C`st||||d|dd�S(NRRtPOST(R$(RRRRR((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytpostsc	C`st||||d|dd�S(NRRtPUT(R$(RRRRR((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytputscC`st||||�S(N(R$(RRRR((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytgetscC`s�ii|dd6d6|dd6i|dd6d6}|drP|d|d<n|drn|j|d�ni|d6}|d}t||||d	|�}|S(
Ntprojecttkeytsummaryt	issuetypetnametdescriptiontfieldss/issue/R(tupdateR&(trestbaseRRtparamstcreatefieldsRRtret((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytcreates



cC`sGi|dd6}|d|dd}t||||d|�}|S(NtcommentR#s/issue/tissues/commentR(R&(R2RRR3RRR5((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pyR71s
cC`sCi|dd6}|d|d}t||||d|�}|S(NR0s/issue/R8R(R((R2RRR3RRR5((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytedit=s
cC`s/|d|d}t||||d�}|S(Ns/issue/R8R(R)(R2RRR3RR5((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytfetchIscC`s�|d|dd}t||||d�}|d}d}x0|dD]$}|d|krJ|d}PqJqJW|s�td	|��n|d|dd}	ii|d6d
6|dd6}
t|	|||d|
�}|S(Ns/issue/R8s/transitionsRRttransitionsR.tids%Failed find valid transition for '%s't
transitionR0(R)tNonet
ValueErrorR&(R2RRR3tturlttmetattargetttidttRRR5((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pyR=Os

cC`sfii|dd6d6i|dd6d6i|dd6d6}|d	}t||||d
|�}|S(NtlinktypeR.ttypetinwardissueR+tinwardIssuetoutwardissuetoutwardIssues/issueLink/R(R&(R2RRR3RRR5((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytlinkhs
R6R*R-R,R7R8R9R:R=RKRERGRIc+C`s�tdtdtdt�dtddddd	d
dgdd
gdt�dtdt�dtdtdt�dt�dt�dt�dt�dtddg�dt�dt�dt�dtdidd�dt�dt�dt�d tdd!dd"�d#tdtdd$��d%t�atjd}g}x/t|D]#}tj|sD|j|�qDqDW|r�tjd&d'|d(j	|�f�ntjd}tjd}tjd}tjdr�itjdd)6tjdd<n|j
d*�s	|d*}n|d+}y8tjt
}t||�}||||tj�}	Wn#tk
rp}
tjd&|
j�SXtjd,td-|	�dS(.Nt
argument_specturitrequiredt	operationtchoicesR6R7R9R:R=RKtaliasestcommandtusernametpasswordtno_logR*R,R/R-R8tticketRtassigneeR0tdefaultRFtdictRERGRIRtfloati
tvalidate_certstbooltsupports_check_modeRs9Operation %s require the following missing parameters: %st,R.t/s
rest/api/2tchangedtmeta(R
RYtTruetFalseRR3tOP_REQUIREDtappendRtjointendswithtsystmodulest__name__tgetattrt	Exceptiontmessaget	exit_json(toptmissingtparmRMRRR2tthismodRR5te((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pytmainsX											

&



"


t__main__("t
__future__RRRRFt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLESRRRhtansible.module_utils._textRR	tansible.module_utils.basicR
tansible.module_utils.urlsRR>R$R&R(R)R6R7R9R:R=RKRYRdRtRj(((sK/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/jira.pyt<module>	s>


ud												A

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]