Skip to content

Commit

Permalink
Merge pull request #24 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored May 8, 2018
2 parents d3d9538 + c884b16 commit ffeab54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ The :program:`im_client` is called like this:
``list``:
List the infrastructure IDs created by the user.

``create <radlfile>``
``create <radlfile> [async_flag]``
Create an infrastructure using RADL specified in the file with path
``radlfile``.
``radlfile``. The ``async_flag`` parameter is optional
and is a flag to specify if the creation call will wait the resources
to be created or return immediately the id of the infrastructure.

``destroy <infId>``
Destroy the infrastructure with ID ``infId``.
Expand Down
7 changes: 6 additions & 1 deletion im_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ def main(operation, options, args, parser):
if not os.path.isfile(args[0]):
print("RADL file '" + args[0] + "' does not exist")
return False
asyncr = False
if len(args) >= 2:
asyncr = bool(int(args[1]))
else:
print("RADL file to create inf. not specified")
return False
Expand All @@ -370,6 +373,8 @@ def main(operation, options, args, parser):
if options.restapi:
headers = {"Authorization": rest_auth_data}
url = "%s/infrastructures" % options.restapi
if asyncr:
url += "?async=yes"
resp = requests.request("POST", url, verify=options.verify, headers=headers, data=str(radl))
success = resp.status_code == 200
inf_id = resp.text
Expand Down Expand Up @@ -888,7 +893,7 @@ def get_parser():
parser.add_option("-v", "--verify-ssl", action="store_true", default=False, dest="verify", help="Verify the certificate of the "
"InfrastructureManager XML-RCP server")
parser.add_operation_help('list', '')
parser.add_operation_help('create', '<radl_file>')
parser.add_operation_help('create', '<radl_file> [async_flag]')
parser.add_operation_help('destroy', '<inf_id>')
parser.add_operation_help('getinfo', '<inf_id> [radl_attribute]')
parser.add_operation_help('getradl', '<inf_id>')
Expand Down

0 comments on commit ffeab54

Please sign in to comment.