Creating, Updating and Deleting Intersight Objects
Creating Intersight resources
To create resources in Intersight, use the isctl create ...
commands.
The attributes for the new object can be passed in as command line flags:
Output:
2020/07/19 13:02:13 Single result, falling back to vertical output. NOTE: this is not valid YAML; use --output yaml to get valid YAML.
Enabled: true
Moid: 5f13b7b56275722d31133e63
Name: isctl-test-1
NtpServers:
- 1.1.1.1
- 2.2.2.2
The output of the create
commands is the resource after it was created in Intersight, so the Moid, etc. are included.
You can also define the attributes of the new object via standard input:
isctl create ntp policy --bodyformat json
Waiting for JSON body:
{
"Name": "isctl-ntp-test",
"Enabled": true,
"NtpServers": [
"1.1.1.1"
],
"Organization": {
"Moid": "123456789012345678901234",
"ClassId": "mo.MoRef"
}
}
This is useful when you have your object defined as a JSON or YAML file, for example:
Deleting resources
Deleting resources is quite simple if you know the Moid:
Or the Name:
Updating resources
Resources can also be updated by Moid or Name. For example, if you want to set the Enabled
attribute in an NTP policy to False
:
Or by Name: