-
Notifications
You must be signed in to change notification settings - Fork 11
AMQP API
A request always has the following structure:
{
"action": <action_type>,
"collection": <collection_name>,
"id": <id>,
"attributes": {
<key1>: <value1>,
<key2>: <value2>,
<key3>: <value3>
},
"filters": {
<filter1>: <value1>,
<filter2>: <value2>,
<filter3>: <value3>
},
}
-
action
andcollection
are mandatory - For a
read
action, if theid
is not specified, the request will get a list of resources available in thecollection
.
Here's an example of renaming a group
name student
to students
:
- Go to section "Groups" of this. It will be the
collection_name
- Pick the right action,
update
- Id is mandatory, it's the group name.
- Fill the attributes section. The key is
new_name
. Set it tostudents
{
"collection": "groups",
"action": "update",
"id": "student",
"attributes": {
"new_name": "students"
}
}
Filters can be applied to any request. You can filter by:
- Uuid:
uuids
- Hostname:
hostnames
(matches wildcards) - IP Address:
ip_addresses
- MAC Address:
mac_addresses
Example:
{
"collection": "hosts",
"action": "read",
"filters": {"hostnames": ["*.guardis.be", "*.guardis.com"]}
}
Retrieves informations about a group.
-
id
: The group name. -
attributes
: A list of informations to retrieve.
Available informations are:
hostname
-
mac
ormac_addresses
memtotal
ip
uptime
platform
Execute command on remote hosts.
-
id
(mandatory): The command. -
attributes
: None
Retrieves informations about a group.
-
id
: The group name. -
attributes
: None
Creates a group with the given name
-
id
(mandatory): The group name -
attributes
: None
Changes a group name.
-
id
(mandatory): The group name -
attributes
:-
new_name
: The new name
-
Deletes a group.
-
id
(mandatory): The group name -
attributes
: None
Gets information about user.
-
id
: The user name. -
attributes
: None
Creates a user.
-
id
(mandatory): The user name. -
attributes
:-
password
: The user's password (clear text) -
login_group
: The user's main group -
groups
: Additionnal groups of the user (comma separated string)
-
Updates a user.
-
id
(mandatory): The user name. -
attributes
:-
password
: The user's password (clear text) -
login_group
: The user's main group -
add_to_groups
: Add user to these groups(comma separated string) -
remove_from_groups
: Remove user from these groups(comma separated string) -
set_groups
: Resets then sets groups for user
-
Deletes a user with the force flag.
-
id
(mandatory): The user name -
attributes
: None
Gets the status installation of a package. Installed or not.
-
id
: The package name. -
attributes
: None
Installs a package.
-
id
(mandatory): The package name. -
attributes
: None
Updates a package.
-
id
: The package name. If not specified, it will update all packages -
attributes
: None
Removes a package.
-
id
(mandatory): The package name. -
attributes
: None
Retrieves the status of a service. (running, enabled)
-
id
(mandatory): The service name. -
attributes
: None
Enable/disable and starts/stop a serevice
-
id
(mandatory): The service name. -
attributes
:-
enabled
: True/False -
running
: True/False
-
Retrieves the owner, group, and mode of a file.
-
id
: The file name. -
attributes
:-
get_content
: (boolean) Additionnaly retrieves the file content -
md5
: (boolean) Calculates the file's md5sum
-
Creates a file. Sets the owner, group, mode, and content of a file.
-
id
: The file name. -
attributes
:-
owner
: Sets the file owner (the user must exist) -
group
: Sets the file group (the group must exist) -
mode
: Sets the file mode -
content
: (string) The file content as a string -
content_by_url
: (url) Fetch the content from this url -
encoding
: Currently supported (None/base64)
-
Deletes a file
-
id
: The file name. -
attributes
: None
Retrieves all package repositories defined if id
isn't provided.
Retrieves a repo details if id
is provided.
-
id
: The repo name -
attributes
:-
details
: (boolean) Additionnaly retrieves repositories details when noid
is specified. Only the names if set tofalse
.
-
Creates or updates a repo. Here, only mandatory attributes are shown.
-
id
: The repo name. -
attributes
:-
baseurl
: (string) The base url for the repo.
-
On Debian, entries follow this minimal format. One file per repository will be
created in /etc/apt/sources.list.d
. The filename will be <id>.list
.
deb http://site.example.com/debian distribution component1 component2 component3
On debian, you can group the baseurl
, distribution
and components
, or
specify them separately:
-
distribution
: (string) See Debian example below. -
components
: (list or comma separated values) See Debian example below.
{
'attributes': {'baseurl': 'http://dl.comodit.com/pub debian-squeeze test test2 test3'},
}
is equivalent to
{
'attributes': {'baseurl': 'http://dl.comodit.com/pub',
'distribution': 'debian-squeeze',
'components': ['test', 'test2', 'test3']},
}
is equivalent to
{
'attributes': {'baseurl': 'http://dl.comodit.com/pub',
'distribution': 'debian-squeeze',
'components': 'test, test2, test3'},
}
On RedHat, entries follow this minimal format. Every other option defined in the yum.conf manpage (enabled, gpgcheck, etc) is available though.
[synapse-dev]
baseurl=http://danube.comodit.net/repo/fedora/16/i386/
Deletes the repo.
-
id
: The repo name.