...
The options and arguments to the rc_cli command may be displayed by invoking it with –help:
Code Block | ||||
---|---|---|---|---|
| ||||
$ ./rc_cli --help usage: rc_cli [-h] [-H HOST] [-u USER] [-p PASSWORD] [-s SORT] [-F] [-Y] obj op [args [args ...]] Perform API calls against a Regional Controller. positional arguments: obj The object to manipulate op The operation to perform on the object args Extra arguments for the operation optional arguments: -h, --help show this help message and exit -H HOST the host of the regional controller (default localhost) -u USER the username to use (default admin) -p PASSWORD the password to use -s SORT the field to sort list views by -F forcibly delete a POD (use with "pod delete") -Y display YAML columns in the output of list commands |
...
The create operation takes as arguments the names of one or more YAML files containing the objects to be created. For successfully created objects, it will print the URL of the newly created object, which contains the object’s UUID. The YAML files provided must contain only YAML descriptions of the appropriate type specified on the command line. The format of these YAML objects can be determined by referencing Regional Controller API Documentation.
Code Block | ||||
---|---|---|---|---|
| ||||
$ ./rc_cli -u admin -p admin123 hardware create hardware.yaml https://localhost/api/v1/hardware/36a72db1-f2d9-424b-b94e-b72ca7a50cfe |
...
show takes as arguments a list of UUIDs of the objects to show the details of.
Code Block | ||||
---|---|---|---|---|
| ||||
$ ./rc_cli -u admin -p admin123 hardware show c1dfa1ac-53e0-11e9-86c2-c313482f1fdb --- description: Standard Dell configuration for Rover/Unicycle name: Dell PowerEdge R740 uuid: c1dfa1ac-53e0-11e9-86c2-c313482f1fdb yaml: cpu: 2x22 Cores @ 2.1GHz Skylake 6152 CPU disk: - 4x480G SSD - 6x2.4T HDD lom: 4x10G Intel 710 nic: - 2x1G LOM Intel 5xx - 2x25G PCI3 Intel 710 ps: 2 ram: 12x32GB |
...
The options and arguments to the rc_loaddata command may be displayed by invoking it with –help:
Code Block | ||||
---|---|---|---|---|
| ||||
$ ./rc_loaddata --help usage: rc_loaddata [-h] [-H HOST] [-u USER] [-p PASSWORD] [-s {hardware,regions,nodes,edgesites,blueprints,pods}] [-A] [-D] [-M] YAML [YAML ...] Add/delete objects from a Regional Controller. The objects are retrieved from one or more YAML files. positional arguments: YAML YAML files containing RC objects to be added/deleted/matched optional arguments: -h, --help show this help message and exit -H HOST the host of the regional controller (default localhost) -u USER the username to use (default admin) -p PASSWORD the password to use -s {hardware,regions,nodes,edgesites,blueprints,pods} only process the named section of the YAMLs (default all) -A add new entries in YAMLs to the RC -D delete entries in YAMLs from the RC -M match entries in YAMLs to the RC |
The purpose of rc_loaddata is to perform operations on large number of RC objects at once. The operation to perform is specified by the -A/-D/-M options, only one of which may be provided.
...
The YAML files themselves consists of stanzas for any of the six sections needed, followed by named objects describing the objects of each type to be added/deleted/matched. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
hardware: Dell_740xd: uuid: 9897a008-71d4-11e9-8bda-0017f20dbff8 description: Dell 740xd hardware for the REC Blueprint yaml: todo: put hardware details here rack_layout: height: 2U regions: zone1: description: The main region that all nodes in the MT lab will all be in. edgesites: REC_OpenEdge1: uuid: 60ab1298-7769-11e9-92b3-373d9b2f2476 description: The first OE REC cluster nodes: [ aknode201, aknode202, aknode203, aknode204, aknode205 ] regions: [ zone1 ] blueprints: nodes: aknode201: hardware: Nokia_OE19 yaml: oob_ip: 172.26.16.201 rack_location: { name: Row4_Rack6, slot: 2, unit: 1 } |