Class: Ansible::Ruby::Modules::Uri

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb,
lib/ansible/ruby/modules/custom/net_tools/basics/uri.rb

Overview

Interacts with HTTP and HTTPS web services and supports Digest, Basic and WSSE HTTP authentication mechanisms. For Windows targets, use the M(win_uri) module instead.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#bodyString, ...

Returns The body of the http request/response to the web service. If C(body_format) is set to ‘json’ it will take an already formatted JSON string or convert a data structure into JSON. If C(body_format) is set to ‘form-urlencoded’ it will convert a dictionary or list of tuples into an ‘application/x-www-form-urlencoded’ string. (Added in v2.7).

Returns:

  • (String, Hash, Array<Array>, Array, nil)

    The body of the http request/response to the web service. If C(body_format) is set to ‘json’ it will take an already formatted JSON string or convert a data structure into JSON. If C(body_format) is set to ‘form-urlencoded’ it will convert a dictionary or list of tuples into an ‘application/x-www-form-urlencoded’ string. (Added in v2.7)



28
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 28

attribute :body

#body_format:"form-urlencoded", ...

Returns The serialization format of the body. When set to C(json) or C(form-urlencoded), encodes the body argument, if needed, and automatically sets the Content-Type header accordingly. As of C(2.3) it is possible to override the ‘Content-Type` header, when set to C(json) or C(form-urlencoded) via the I(headers) option.

Returns:

  • (:"form-urlencoded", :json, :raw, nil)

    The serialization format of the body. When set to C(json) or C(form-urlencoded), encodes the body argument, if needed, and automatically sets the Content-Type header accordingly. As of C(2.3) it is possible to override the ‘Content-Type` header, when set to C(json) or C(form-urlencoded) via the I(headers) option.



32
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 32

attribute :body_format

#client_certObject?

Returns PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, I(client_key) is not required.

Returns:

  • (Object, nil)

    PEM formatted certificate chain file to be used for SSL client authentication. This file can also include the key as well, and if the key is included, I(client_key) is not required



80
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 80

attribute :client_cert

#client_keyObject?

Returns PEM formatted file that contains your private key to be used for SSL client authentication. If I(client_cert) contains both the certificate and key, this option is not required.

Returns:

  • (Object, nil)

    PEM formatted file that contains your private key to be used for SSL client authentication. If I(client_cert) contains both the certificate and key, this option is not required.



83
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 83

attribute :client_key

#createsObject?

Returns A filename, when it already exists, this step will not be run.

Returns:

  • (Object, nil)

    A filename, when it already exists, this step will not be run.



52
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 52

attribute :creates

#destObject?

Returns A path of where to download the file to (if desired). If I(dest) is a directory, the basename of the file on the remote server will be used.

Returns:

  • (Object, nil)

    A path of where to download the file to (if desired). If I(dest) is a directory, the basename of the file on the remote server will be used.



17
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 17

attribute :dest

#follow_redirects:all, ...

Returns Whether or not the URI module should follow redirects. C(all) will follow all redirects. C(safe) will follow only “safe” redirects, where “safe” means that the client is only doing a GET or HEAD on the URI to which it is being redirected. C(none) will not follow any redirects. Note that C(yes) and C(no) choices are accepted for backwards compatibility, where C(yes) is the equivalent of C(all) and C(no) is the equivalent of C(safe). C(yes) and C(no) are deprecated and will be removed in some future version of Ansible.

Returns:

  • (:all, :none, :safe, nil)

    Whether or not the URI module should follow redirects. C(all) will follow all redirects. C(safe) will follow only “safe” redirects, where “safe” means that the client is only doing a GET or HEAD on the URI to which it is being redirected. C(none) will not follow any redirects. Note that C(yes) and C(no) choices are accepted for backwards compatibility, where C(yes) is the equivalent of C(all) and C(no) is the equivalent of C(safe). C(yes) and C(no) are deprecated and will be removed in some future version of Ansible.



48
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 48

attribute :follow_redirects

#force_basic_auth:yes, ...

Returns The library used by the uri module only sends authentication information when a webservice responds to an initial request with a 401 status. Since some basic auth services do not properly send a 401, logins will fail. This option forces the sending of the Basic authentication header upon initial request.

Returns:

  • (:yes, :no, nil)

    The library used by the uri module only sends authentication information when a webservice responds to an initial request with a 401 status. Since some basic auth services do not properly send a 401, logins will fail. This option forces the sending of the Basic authentication header upon initial request.



44
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 44

attribute :force_basic_auth

#headersHash?

Returns Add custom HTTP headers to a request in the format of a YAML hash. As of C(2.3) supplying C(Content-Type) here will override the header generated by supplying C(json) or C(form-urlencoded) for I(body_format).

Returns:

  • (Hash, nil)

    Add custom HTTP headers to a request in the format of a YAML hash. As of C(2.3) supplying C(Content-Type) here will override the header generated by supplying C(json) or C(form-urlencoded) for I(body_format).



69
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 69

attribute :headers

#method:GET, ...

Returns The HTTP method of the request or response. It MUST be uppercase.

Returns:

  • (:GET, :POST, :PUT, :HEAD, :DELETE, :OPTIONS, :PATCH, :TRACE, :CONNECT, :REFRESH, nil)

    The HTTP method of the request or response. It MUST be uppercase.



36
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 36

attribute :method

#othersObject?

Returns All arguments accepted by the M(file) module also work here.

Returns:

  • (Object, nil)

    All arguments accepted by the M(file) module also work here



73
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 73

attribute :others

#passwordString?

Returns A password for the module to use for Digest, Basic or WSSE authentication.

Returns:

  • (String, nil)

    A password for the module to use for Digest, Basic or WSSE authentication.



24
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 24

attribute :password

#remote_src:yes, ...

Returns If C(no), the module will search for src on originating/master machine, if C(yes) the module will use the C(src) path on the remote/target machine.

Returns:

  • (:yes, :no, nil)

    If C(no), the module will search for src on originating/master machine, if C(yes) the module will use the C(src) path on the remote/target machine.



90
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 90

attribute :remote_src

#removesObject?

Returns A filename, when it does not exist, this step will not be run.

Returns:

  • (Object, nil)

    A filename, when it does not exist, this step will not be run.



55
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 55

attribute :removes

#return_content:yes, ...

Returns Whether or not to return the body of the response as a “content” key in the dictionary result. If the reported Content-type is “application/json”, then the JSON is additionally loaded into a key called C(json) in the dictionary results.

Returns:

  • (:yes, :no, nil)

    Whether or not to return the body of the response as a “content” key in the dictionary result. If the reported Content-type is “application/json”, then the JSON is additionally loaded into a key called C(json) in the dictionary results.



40
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 40

attribute :return_content

#srcString?

Returns Path to file to be submitted to the remote server. Cannot be used with I(body).

Returns:

  • (String, nil)

    Path to file to be submitted to the remote server. Cannot be used with I(body).



86
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 86

attribute :src

#status_codeInteger?

Returns A list of valid, numeric, HTTP status codes that signifies success of the request.

Returns:

  • (Integer, nil)

    A list of valid, numeric, HTTP status codes that signifies success of the request.



58
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 58

attribute :status_code

#timeoutInteger?

Returns The socket level timeout in seconds.

Returns:

  • (Integer, nil)

    The socket level timeout in seconds



62
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 62

attribute :timeout

#urlString

Returns HTTP or HTTPS URL in the form (http|https)://host.domain/path.

Returns:



13
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 13

attribute :url

#userString?

Returns A username for the module to use for Digest, Basic or WSSE authentication.

Returns:

  • (String, nil)

    A username for the module to use for Digest, Basic or WSSE authentication.



20
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 20

attribute :user

#validate_certs:yes, ...

Returns If C(no), SSL certificates will not be validated. This should only set to C(no) used on personally controlled sites using self-signed certificates. Prior to 1.9.2 the code defaulted to C(no).

Returns:

  • (:yes, :no, nil)

    If C(no), SSL certificates will not be validated. This should only set to C(no) used on personally controlled sites using self-signed certificates. Prior to 1.9.2 the code defaulted to C(no).



76
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/uri.rb', line 76

attribute :validate_certs