-
Notifications
You must be signed in to change notification settings - Fork 88
RESTful API For Minion
Echo edited this page Apr 20, 2018
·
6 revisions
Request
GET /saltshaker/api/v1.0/minions/status?product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
{
"status": "up",
"minions_id": "10.10.10.10"
},
{
"status": "up",
"minions_id": "10.10.10.11"
}
],
"status": true,
"message": ""
}
Request
GET /saltshaker/api/v1.0/minions/key?product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
{
"minions_status": "Accepted",
"minions_id": "10.10.10.10"
},
{
"minions_status": "Accepted",
"minions_id": "10.10.10.11"
}
],
"status": true,
"message": ""
}
Request
POST /saltshaker/api/v1.0/minions/keys?action=accept&product_id=p-c5008b0421d611e894b0000c298454d8
POST Body
{
"minion_id": ["10.11.1.1","10.45.44.44"]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": ""
}
Request
POST /saltshaker/api/v1.0/minions/keys?action=delete&product_id=p-c5008b0421d611e894b0000c298454d8
POST Body
{
"minion_id": ["10.11.1.1","10.45.44.44"]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": ""
}
Request
POST /saltshaker/api/v1.0/minions/keys?action=reject&product_id=p-c5008b0421d611e894b0000c298454d8
POST Body
{
"minion_id": ["10.11.1.1","10.45.44.44"]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": ""
}
Request
GET /saltshaker/api/v1.0/minions/grains?minion=echo&product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"echo": {
"biosversion": "6.00",
"kernel": "Linux",
"domain": "",
"biosreleasedate": "05/19/2017",
"zmqversion": "4.1.4",
"kernelrelease": "4.13.0-36-generic",
"pythonpath": [
"/usr/local/lib/python2.7/dist-packages/git/ext/gitdb",
"/usr/bin",
"/usr/lib/python2.7",
"/usr/lib/python2.7/plat-x86_64-linux-gnu",
"/usr/lib/python2.7/lib-tk",
"/usr/lib/python2.7/lib-old",
"/usr/lib/python2.7/lib-dynload",
"/usr/local/lib/python2.7/dist-packages",
"/usr/lib/python2.7/dist-packages",
"/usr/local/lib/python2.7/dist-packages/gitdb/ext/smmap"
],
"serialnumber": "VMware-56 4d 08 79 ec 47 6e fa-d9 50 98 b0 2c 84 54 d8",
"ip_interfaces": {
"ens33": [
"192.168.44.128",
"fe80::dd47:53fb:935:8717"
],
"lo": [
"127.0.0.1",
"::1"
],
"docker0": [
"172.17.0.1"
],
"docker_gwbridge": [
"172.18.0.1",
"fe80::42:80ff:fe7d:e0cc"
],
"veth5b70854": [
"fe80::8815:7ff:feec:fa33"
]
},
"shell": "/bin/sh",
"mem_total": 3922,
"saltversioninfo": [
2015,
8,
8,
0
],
"SSDs": [],
"mdadm": [],
"id": "echo",
"osrelease": "16.04",
"ps": "ps -efHww",
"systemd": {
"version": "229",
"features": "+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN"
},
"uuid": "564d0879-ec47-6efa-d950-98b02c8454d8",
"ip6_interfaces": {
"ens33": [
"fe80::dd47:53fb:935:8717"
],
"lo": [
"::1"
],
"docker0": [],
"docker_gwbridge": [
"fe80::42:80ff:fe7d:e0cc"
],
"veth5b70854": [
"fe80::8815:7ff:feec:fa33"
]
},
"num_cpus": 2,
"hwaddr_interfaces": {
"ens33": "00:0c:29:84:54:d8",
"lo": "00:00:00:00:00:00",
"docker0": "02:42:f8:da:97:d3",
"docker_gwbridge": "02:42:80:7d:e0:cc",
"veth5b70854": "8a:15:07:ec:fa:33"
},
"init": "systemd",
"ip4_interfaces": {
"ens33": [
"192.168.44.128"
],
"lo": [
"127.0.0.1"
],
"docker0": [
"172.17.0.1"
],
"docker_gwbridge": [
"172.18.0.1"
],
"veth5b70854": []
},
"lsb_distrib_description": "Ubuntu 16.04.3 LTS",
"osfullname": "Ubuntu",
"master": "127.0.0.1",
"ipv4": [
"127.0.0.1",
"172.17.0.1",
"172.18.0.1",
"192.168.44.128"
],
"ipv6": [
"::1",
"fe80::42:80ff:fe7d:e0cc",
"fe80::8815:7ff:feec:fa33",
"fe80::dd47:53fb:935:8717"
],
"cpu_flags": [
"fpu",
"vme",
"de",
"pse",
"tsc",
"msr",
"pae",
"mce",
"cx8",
"apic",
"sep",
"mtrr",
"pge",
"mca",
"cmov",
"pat",
"pse36",
"clflush",
"mmx",
"fxsr",
"sse",
"sse2",
"ss",
"ht",
"syscall",
"nx",
"pdpe1gb",
"rdtscp",
"lm",
"constant_tsc",
"arch_perfmon",
"nopl",
"xtopology",
"tsc_reliable",
"nonstop_tsc",
"cpuid",
"pni",
"pclmulqdq",
"ssse3",
"fma",
"cx16",
"pcid",
"sse4_1",
"sse4_2",
"x2apic",
"movbe",
"popcnt",
"tsc_deadline_timer",
"aes",
"xsave",
"avx",
"f16c",
"rdrand",
"hypervisor",
"lahf_lm",
"abm",
"cpuid_fault",
"invpcid_single",
"pti",
"retpoline",
"fsgsbase",
"tsc_adjust",
"bmi1",
"avx2",
"smep",
"bmi2",
"invpcid",
"xsaveopt",
"arat"
],
"localhost": "echo",
"lsb_distrib_id": "Ubuntu",
"fqdn_ip4": [
"127.0.1.1"
],
"fqdn_ip6": [],
"nodename": "echo",
"saltversion": "2015.8.8",
"lsb_distrib_release": "16.04",
"server_id": 2033023759,
"saltpath": "/usr/lib/python2.7/dist-packages/salt",
"host": "echo",
"os_family": "Debian",
"oscodename": "xenial",
"osfinger": "Ubuntu-16.04",
"pythonversion": [
2,
7,
12,
"final",
0
],
"manufacturer": "VMware, Inc.",
"num_gpus": 1,
"virtual": "VMWare",
"cpu_model": "Intel(R) Core(TM) i5-4310M CPU @ 2.70GHz",
"fqdn": "echo",
"pythonexecutable": "/usr/bin/python",
"productname": "VMware Virtual Platform",
"osarch": "amd64",
"cpuarch": "x86_64",
"lsb_distrib_codename": "xenial",
"osrelease_info": [
16,
4
],
"locale_info": {
"detectedencoding": "UTF-8",
"defaultlanguage": "en_US",
"defaultencoding": "UTF-8"
},
"gpus": [
{
"model": "SVGA II Adapter",
"vendor": "unknown"
}
],
"path": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"machine_id": "612de665ab1a4713a845325b46b41968",
"os": "Ubuntu"
},
"status": true,
"message": ""
}
Request
GET /saltshaker/api/v1.0/minions/grains?minion=echo&item=pythonpath&product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"echo": {
"pythonpath": [
"/usr/local/lib/python2.7/dist-packages/git/ext/gitdb",
"/usr/bin",
"/usr/lib/python2.7",
"/usr/lib/python2.7/plat-x86_64-linux-gnu",
"/usr/lib/python2.7/lib-tk",
"/usr/lib/python2.7/lib-old",
"/usr/lib/python2.7/lib-dynload",
"/usr/local/lib/python2.7/dist-packages",
"/usr/lib/python2.7/dist-packages",
"/usr/local/lib/python2.7/dist-packages/gitdb/ext/smmap"
]
},
"status": true,
"message": ""
}