/rbkcli/cmdlet
Methods
get
'responses': { '200': { 'description': str('Returns a list of avail' 'able cmdlets'), 'schema': { 'items': { 'CmdletsInfo': { 'properties': { 'cmdlet_description': { 'description': 'Description of the cmdlet being added', 'type': 'string' }, 'cmdlet_summary': { 'description': 'Short description of cmdlet being added', 'type': 'string' }, 'command': { 'description': 'List of rbkcli existing commands which the cmdlet will trigger, each command can have a "<parameter>" entry which will be replaced by the parameter provided', 'type': 'array' }, 'id': { 'description': 'Auto generated UUID version 4 stored with the cmdlet', 'type': 'string' }, 'multiple_output': { 'description': 'Format of the json output of multiple commands triggered, segmented per command triggered or combined in one json.', 'enum': [ 'segmented', 'combined' ], 'type': 'string' }, 'name': { 'description': 'The display name of the cmdlet, which will be used to call it.', 'type': 'string' }, 'param': { 'description': 'Parameter to replace in the commands, provided in a comma separated list.', 'type': 'string' }, 'profile': { 'description': 'Name of the file where the cmdlets are saved, default is cmdlets.json', 'type': 'string' }, 'response_description': { 'description': 'Description of the json response returned by the cmdlet.', 'type': 'string' }, 'status': { 'description': 'Result of a verification of all cmdlets names, if is duplicated the cmdlet wont\'t be usable and will be flagged as duplicated.', 'enum': [ 'usable', 'duplicated' ], 'type': 'string' }, } } } }, 'table_order': ['profile','status','cmdlet','cmdlet_summary','multiple_output'] } }, `[ { "cmdlet_description": "<value>", "cmdlet_summary": "<value>", "command": [ "<value>", "<value>" ], "id": "<value>", "multiple_output": "<value>", "name": "<value>", "param": "<value>,<value>", "profile": "<value>.json", "response_description": "<value>", "status": "<value>" } ]
$ rbkcli cmdlet [ { "cmdlet_description": "", "cmdlet_summary": "Retrieves a list of VMs in Silver SLA", "command": [ "vmware vm -f effectiveSlaDomainName~Silver --loop id \"vmware vm {id}\" -c snapshots" ], "id": "e6d131a8-7d3b-42d2-a34a-8be19e0897d3", "multiple_output": "segmented", "name": "DemoCmdlet silver_vms", "param": "", "profile": "cmdlets.json", "response_description": "", "status": "usable" }, { "cmdlet_description": "", "cmdlet_summary": "Retrieves a list of VMs in Bronze SLA", "command": [ "vmware vm -f effectiveSlaDomainName~Bronze --loop id \"vmware vm {id}\" -c snapshots" ], "id": "199d77c5-5de5-46b9-8004-69bc8732abee", "multiple_output": "segmented", "name": "DemoCmdlet bronze_vms", "param": "", "profile": "cmdlets.json", "response_description": "", "status": "usable" } ]$ rbkcli cmdlet -s name,profile,status,cmdlet_summary,command -T name | profile | status | cmdlet_summary | command ================================================================================================================================================================================ DemoCmdlet silver_vms | cmdlets.json | usable | Retrieves a list of VMs in Silver SLA | ['vmware vm -f effectiveSlaDomainName~Silver --loop id "vmware vm {id}" -c snapshots'] DemoCmdlet bronze_vms | cmdlets.json | usable | Retrieves a list of VMs in Bronze SLA | ['vmware vm -f effectiveSlaDomainName~Bronze --loop id "vmware vm {id}" -c snapshots'] **Total amount of objects [2]
'parameters': [ { 'name': 'cmdlet_description', 'description': 'Description of the cmdlet being added.', 'in': 'body', 'required': False, 'type': 'string' }, { 'name': 'cmdlet_summary', 'description': 'Short description of cmdlet being added', 'in': 'body', 'required': False, 'type': 'string' }, { 'name': 'command', 'description': 'List of rbkcli existing commands which the cmdlet will trigger, each command can have a "<parameter>" entry which will be replaced by the parameter provided', 'in': 'body', 'required': True, 'type': 'array/string' }, { 'name': 'multiple_output', 'description': 'Format of the json output of multiple commands triggered, segmented per command triggered or combined in one json.', 'enum': [ 'segmented', 'combined' ], 'in': 'body', 'required': False, 'type': 'string' }, { 'name': 'name', 'description': 'The display name of the cmdlet, which will be used to call it.', 'in': 'body', 'required': True, 'type': 'string' }, { 'name': 'param', 'description': 'Parameter to replace in the commands, provided in a comma separated list.', 'in': 'body', 'required': False, 'type': 'string' }, { 'name': 'profile', 'description': 'Name of the file where the cmdlets are saved, default is cmdlets.json.', 'in': 'body', 'required': True, 'type': 'string' }, { 'name': 'response_description', 'description': 'Description of the json response returned by the cmdlet.', 'in': 'body', 'required': False, 'type': 'string' }, ],'responses': { '200': { 'description': str('Returns status of the add task.'), 'schema': { 'CmdletCreationInfo': { 'properties': { 'result': { 'description': 'The result of the requested operation.', 'enum': [ 'Succeeded', 'Failed' ], 'type': 'string' }, 'message': { 'description': 'Message(s) explaining how was the execution of the requested operation.', 'type': 'array' }, 'data': { 'description': 'If operation succeeds, returns the created object.', 'type': 'json' } } } } } },{ "result": "<value>", "message": [ "<value>", "<value>" ], "cmdlet_to_add": { "id": "<value>", "profile": "<value>", "name": "<value>", "cmdlet_summary": "<value>", "cmdlet_description": "<value>", "command": [ "<value>", "<value>" ], "multiple_output": "<value>", "param": "<value>", "response_description": "<value>" } }
$ rbkcli cmdlet -m post -p 'name=bronze_vms,profile=cmdlets.json,command=vmware vm -f effectiveSlaDomainName~Bronze' { "result": "Succeeded", "message": [], "cmdlet_to_add": { "id": "e12a0731-a29b-4c9a-90c6-e32752fe017f", "profile": "cmdlets.json", "name": "bronze_vms", "cmdlet_summary": "", "cmdlet_description": "", "command": [ "vmware vm -f effectiveSlaDomainName~Bronze" ], "multiple_output": "segmented", "param": "", "response_description": "" } }$ rbkcli cmdlet -m post -p '{"name": "vm snaps","profile": "cmdlets.json", "command": ["vmware vm -f effectiveSlaDomainName~Bronze --loop id \"vmware vm {id}\" -c snapshots"]}' { "result": "Succeeded", "message": [], "cmdlet_to_add": { "id": "de0a07bb-5c12-427b-9bdc-3660865ce102", "profile": "cmdlets.json", "name": "vm snaps", "cmdlet_summary": "", "cmdlet_description": "", "command": [ "vmware vm -f effectiveSlaDomainName~Bronze --loop id \"vmware vm {id}\" -c snapshots" ], "multiple_output": "segmented", "param": "", "response_description": "" } }
'parameters': [ { 'name': 'id', 'description': 'Id(s) of the cmdlet that will be deleted.', 'in': 'body', 'required': True, 'type': 'string/array' } ],'responses': { '200': { 'description': str('Returns status of the add task.'), 'schema': { 'CmdletCreationInfo': { 'properties': { 'result': { 'description': 'The result of the requested operation.', 'enum': [ 'Succeeded', 'Failed' ], 'type': 'string' }, 'message': { 'description': 'Message(s) explaining how was the execution of the requested operation.', 'type': 'array' }, 'data': { 'description': 'If operation succeeds, returns the deleted object.', 'type': 'json' } } } } } },{ "result": "<value>", "message": [ "<value>", "<value>" ], "data": { "id": "<value>", "profile": "<value>", "name": "<value>", "cmdlet_summary": "<value>", "cmdlet_description": "<value>", "command": [ "<value>", "<value>" ], "multiple_output": "<value>", "param": "<value>", "response_description": "<value>" } }
$ rbkcli cmdlet -m delete -p id=4f6af2d2-28ba-4635-81c3-f6b22f61f2e0 [ { "result": "Succeeded.", "message": "Found the following cmdlets with the provided ID(s).", "data": { "cmdlet_description": "", "cmdlet_summary": "", "command": [ "vmware vm -f effectiveSlaDomainName~Bronze --loop id \"vmware vm {id}\" -c snapshots" ], "id": "4f6af2d2-28ba-4635-81c3-f6b22f61f2e0", "multiple_output": "segmented", "name": "vm snaps", "param": "", "profile": "cmdlets.json", "response_description": "" } } ]
Last updated