mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
nso_action for Cisco NSO (#32781)
nso_action module for execution actions/RPCs in NSO.
This commit is contained in:
committed by
John R Barker
parent
29d3505cb4
commit
b2bc98c161
212
test/units/modules/network/nso/fixtures/complex_schema.json
Normal file
212
test/units/modules/network/nso/fixtures/complex_schema.json
Normal file
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"meta": {
|
||||
"prefix": "ansible",
|
||||
"namespace": "http://example.com/ansible",
|
||||
"types": {
|
||||
},
|
||||
"keypath": "/ansible:action/complex"
|
||||
},
|
||||
"data": {
|
||||
"kind": "action",
|
||||
"mandatory": true,
|
||||
"name": "complex",
|
||||
"qname": "ansible:complex",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": true,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"is_action_input": true,
|
||||
"name": "number",
|
||||
"qname": "ansible:number",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "uint8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "container",
|
||||
"is_action_input": true,
|
||||
"mandatory": true,
|
||||
"name": "ansible",
|
||||
"qname": "ansible:ansible",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"kind": "choice",
|
||||
"cases": [
|
||||
{
|
||||
"kind": "case",
|
||||
"name": "version",
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"is_action_input": true,
|
||||
"name": "version",
|
||||
"qname": "ansible:version",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "case",
|
||||
"name": "release",
|
||||
"children": [
|
||||
{
|
||||
"kind": "container",
|
||||
"is_action_input": true,
|
||||
"mandatory": true,
|
||||
"name": "release",
|
||||
"qname": "ansible:release",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"is_action_input": true,
|
||||
"name": "major",
|
||||
"qname": "ansible:major",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "uint8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "leaf",
|
||||
"is_action_input": true,
|
||||
"name": "minor",
|
||||
"qname": "ansible:minor",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "uint8"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "version-releae-choice"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "choice",
|
||||
"cases": [
|
||||
{
|
||||
"kind": "case",
|
||||
"name": "version",
|
||||
"children": [
|
||||
{
|
||||
"kind": "list",
|
||||
"min_elements": 0,
|
||||
"name": "version",
|
||||
"max_elements": "unbounded",
|
||||
"qname": "ansible:version",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"mandatory": true,
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"name": "name",
|
||||
"qname": "ansible:name",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "string"
|
||||
},
|
||||
"is_action_output": true
|
||||
}
|
||||
],
|
||||
"is_action_output": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "case",
|
||||
"name": "release",
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"name": "release",
|
||||
"qname": "ansible:release",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "string"
|
||||
},
|
||||
"is_action_output": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "version-release-choice"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"meta": {
|
||||
"prefix": "ncs",
|
||||
"namespace": "http://tail-f.com/ns/ncs",
|
||||
"types": {
|
||||
},
|
||||
"keypath": "/ncs:devices/device{ce0}/description"
|
||||
},
|
||||
"data": {
|
||||
"info": {
|
||||
"string": "Free form textual description"
|
||||
},
|
||||
"kind": "leaf",
|
||||
"name": "description",
|
||||
"qname": "ncs:description",
|
||||
"access": {
|
||||
"read": true,
|
||||
"create": true,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": true
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
178
test/units/modules/network/nso/fixtures/sync_from_schema.json
Normal file
178
test/units/modules/network/nso/fixtures/sync_from_schema.json
Normal file
@@ -0,0 +1,178 @@
|
||||
{
|
||||
"meta": {
|
||||
"prefix": "ncs",
|
||||
"namespace": "http://tail-f.com/ns/ncs",
|
||||
"types": {
|
||||
"http://tail-f.com/ns/ncs:outformat2": [
|
||||
{
|
||||
"name": "http://tail-f.com/ns/ncs:outformat2",
|
||||
"enumeration": [
|
||||
{
|
||||
"info": "NCS CLI curly bracket format.",
|
||||
"label": "cli"
|
||||
},
|
||||
{
|
||||
"info": "NETCONF XML edit-config format, i.e., the edit-config that\nwould be applied locally (at NCS) to get a config\nthat is equal to that of the managed device.",
|
||||
"label": "xml"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"keypath": "/ncs:devices/device{ce0}/sync-from"
|
||||
},
|
||||
"data": {
|
||||
"info": {
|
||||
"string": "Synchronize the config by pulling from the device"
|
||||
},
|
||||
"kind": "action",
|
||||
"mandatory": true,
|
||||
"name": "sync-from",
|
||||
"qname": "ncs:sync-from",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": true,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"kind": "container",
|
||||
"is_action_input": true,
|
||||
"name": "dry-run",
|
||||
"presence": true,
|
||||
"qname": "ncs:dry-run",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"info": {
|
||||
"string": "Report what would be done towards CDB, without\nactually doing anything."
|
||||
},
|
||||
"kind": "leaf",
|
||||
"is_action_input": true,
|
||||
"name": "outformat",
|
||||
"qname": "ncs:outformat",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": true,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"namespace": "http://tail-f.com/ns/ncs",
|
||||
"name": "outformat2"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "choice",
|
||||
"cases": [
|
||||
{
|
||||
"kind": "case",
|
||||
"name": "result",
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"name": "result",
|
||||
"qname": "ncs:result",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "boolean"
|
||||
},
|
||||
"is_action_output": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "case",
|
||||
"name": "result-xml",
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"name": "result-xml",
|
||||
"is_cli_preformatted": true,
|
||||
"qname": "ncs:result-xml",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "string"
|
||||
},
|
||||
"is_action_output": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "case",
|
||||
"name": "cli",
|
||||
"children": [
|
||||
{
|
||||
"kind": "leaf",
|
||||
"name": "cli",
|
||||
"is_cli_preformatted": true,
|
||||
"qname": "ncs:cli",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "string"
|
||||
},
|
||||
"is_action_output": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "outformat"
|
||||
},
|
||||
{
|
||||
"info": {
|
||||
"string": "If present, contains additional information about the result."
|
||||
},
|
||||
"kind": "leaf",
|
||||
"name": "info",
|
||||
"qname": "ncs:info",
|
||||
"access": {
|
||||
"read": false,
|
||||
"create": false,
|
||||
"execute": false,
|
||||
"update": false,
|
||||
"delete": false
|
||||
},
|
||||
"type": {
|
||||
"primitive": true,
|
||||
"name": "string"
|
||||
},
|
||||
"is_action_output": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user