(Click to open topic with navigation)
This section describes behavior of the Credential object in Moab Web Services. It contains the URLs, request bodies, and responses delivered to and from MWS.
The Credential API is new with API version 2. The supported methods table below requires each resource to be accessed with a URL parameter of api-version=3.
For more information, see 5.219 Requesting Specific API Versions.
The Fields: Credentials reference contains the type and description of all fields in the Credential object.
Supported methods
Resource | GET | PUT | POST | DELETE |
---|---|---|---|---|
/rest/credentials/accounts | Modify Account Credentials | -- | -- | |
/rest/credentials/classes | Modify Class Credentials | -- | -- | |
/rest/credentials/groups | Modify Group Credentials | -- | -- | |
/rest/credentials/qoses | Modify QoS Credentials | -- | -- | |
/rest/credentials/users | Modify User Credentials | -- | -- | |
/rest/credentials/belongs-to | -- | -- | -- |
In this topic:
The HTTP GET method is used to retrieve Resource Type information.
Quick reference
GET http://localhost:8080/mws/rest/credentials/accounts[/<name>]?api-version=3 GET http://localhost:8080/mws/rest/credentials/classes[/<name>]?api-version=3 GET http://localhost:8080/mws/rest/credentials/groups[/<name>]?api-version=3 GET http://localhost:8080/mws/rest/credentials/qoses[/<name>]?api-version=3 GET http://localhost:8080/mws/rest/credentials/users[/<name>]?api-version=3
5.227.1.A Get All Account Credentials
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/accounts?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/accounts?api-version=3
------------------------------------
{
"totalCount": 1,
"resultCount": 1,
"results": [
{
"name": "Administration",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"variables": {}
}
]
}
5.227.1.B Get Single Account Credential
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/accounts/<name>?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/accounts/Administration?api-version=3
------------------------------------
{
"name": "Administration",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"user_access_list": ["adaptive"],
"variables": {}
}
5.227.1.C Get All Class Credentials
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/classes?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/classes?api-version=3
------------------------------------
{
"totalCount": 1,
"resultCount": 1,
"results": [
{
"name": "highprio",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"variables": {}
}
]
}
5.227.1.D Get Single Class Credential
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/classes/<name>?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/classes/highprio?api-version=3
------------------------------------
{
"name": "highprio",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"variables": {},
"user_access_list": ["adaptive"]
}
5.227.1.E Get All Group Credentials
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/groups/<name>?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/groups?api-version=3
------------------------------------
{
"totalCount": 1,
"resultCount": 1,
"results": [
{
"name": "students",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"variables": {}
}
5.227.1.F Get Single Group Credential
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/groups/<name>?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/groups/students?api-version=3
------------------------------------
{
"name": "students",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"variables": {},
"user_access_list": ["adaptive"]
}
5.227.1.G Get All QoS Credentials
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/qoses?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/qoses?api-version=3
------------------------------------
{
"totalCount": 1,
"resultCount": 1,
"results": [
{
"name": "special",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"variables": {},
"flags": [
"DEADLINE",
"RESERVEALWAYS",
"DEDICATED"
]
"queue_time_weight": 30,
"expansion_factor_weight": 40,
"quality_of_service_priority": 20
}
]
}
5.227.1.H Get Single QoS Credential
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/qoses/<name>?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/qoses/special?api-version=3
------------------------------------
{
"name": "special",
"account_access_list": ["Administration"],
"default_account": "Administration",
"qos_access_list": [
"qos1",
"qos2"
],
"default_qos": "qos1",
"partition_access_list": [
"partition1",
"SHARED"
],
"default_partition": "partition1",
"target_type": "CEILING",
"target": 18.43,
"priority": 53,
"max_job_duration_in_seconds": 234,
"max_idle_jobs": "42",
"max_jobs": "523",
"max_processors": "4",
"max_processor_seconds": "525",
"max_nodes": "75",
"reservation": "system.1",
"variables": {},
"user_access_list": ["adaptive"]
"flags": [
"DEADLINE",
"RESERVEALWAYS",
"DEDICATED"
]
"queue_time_weight": 30,
"expansion_factor_weight": 40,
"quality_of_service_priority": 20
}
5.227.1.I Get All User Credentials
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/users?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/users?api-version=3 ------------------------------------ { { "totalCount": 1, "resultCount": 1, "results": [ { "name": "root", "account_access_list": ["Administration"], "default_account": "Administration", "qos_access_list": [ "qos1", "qos2" ], "default_qos": "qos1", "partition_access_list": [ "partition1", "SHARED" ], "default_partition": "partition1", "target_type": "CEILING", "target": 18.43, "priority": 53, "max_job_duration_in_seconds": 234, "max_idle_jobs": "42", "max_jobs": "523", "max_processors": "4", "max_processor_seconds": "525", "max_nodes": "75", "email": "[email protected]", "variables": {} } ] }
5.227.1.J Get Single User Credential
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/users/<name>?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/credentials/users/root?api-version=3 ------------------------------------ { "name": "root", "account_access_list": ["Administration"], "default_account": "Administration", "qos_access_list": [ "qos1", "qos2" ], "default_qos": "qos1", "partition_access_list": [ "partition1", "SHARED" ], "default_partition": "partition1", "target_type": "CEILING", "target": 18.43, "priority": 53, "max_job_duration_in_seconds": 234, "max_idle_jobs": "42", "max_jobs": "523", "max_processors": "4", "max_processor_seconds": "525", "max_nodes": "75", "email": "[email protected]", "variables": {} }
5.227.1.K Get Credentials to which the User Belongs
Returns the groups, accounts, classes, and qualities of service to which the current user has access.
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/belongs-to?api-version=3
See 5.217 Global URL Parameters for available URL parameters.
Sample response
{
"account_access_list": [
"Test",
"Research",
"Engineering"
],
"class_access_list": [
"batch3",
"batch2",
"batch"
],
"group_access_list": [
"hgranger"
],
"qos_access_list": [
"high",
"medium",
"low"
]
}
The HTTP PUT method is used to modify credentials.
Quick reference
PUT http://localhost:8080/mws/rest/credentials/accounts/<name>?api-version=3[&change-mode=<add|remove|set>]
PUT http://localhost:8080/mws/rest/credentials/classes/<name>?api-version=3[&change-mode=<add|remove|set>]
PUT http://localhost:8080/mws/rest/credentials/groups/<name>?api-version=3[&change-mode=<add|remove|set>]
PUT http://localhost:8080/mws/rest/credentials/qoses/<name>?api-version=3[&change-mode=<add|remove|set>]
PUT http://localhost:8080/mws/rest/credentials/users/<name>?api-version=3[&change-mode=<add|remove|set>]
URL parameters
URL parameters for modifying a credential.
Credentials parameter | Required | Type | Valid values | Description |
---|---|---|---|---|
change-mode | No | String |
set (default) add remove |
If set, replace existing list with the given one. If add, add the given field(s) to the existing list. If remove, remove the given field(s) from the existing list. |
Moab Workload Manager will automatically add SHARED and the value of default_partition to the partition_access_list.
5.227.2.A Modify Account Credentials
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/accounts/<name>?api-version=3[&change-mode=<add|remove|set>]
See 5.217 Global URL Parameters for available URL parameters.
Sample body
PUT http://localhost:8080/mws/rest/credentials/accounts/biology?api-version=3&change-mode=add
------------------------------------
{
"qos_access_list": [
"qos3",
"qos4"
],
"max_job_duration_in_seconds": 234
}
5.227.2.B Modify Class Credentials
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/classes/<name>?api-version=3[&change-mode=<add|remove|set>]
See 5.217 Global URL Parameters for available URL parameters.
Sample body
PUT http://localhost:8080/mws/rest/credentials/classes/highprio?api-version=3
------------------------------------
{
"max_idle_jobs": "50",
"max_jobs": "300"
}
5.227.2.C Modify Group Credentials
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/groups/<name>?api-version=3[&change-mode=<add|remove|set>]
See 5.217 Global URL Parameters for available URL parameters.
Sample body
PUT http://localhost:8080/mws/rest/credentials/groups/students?api-version=3&change-mode=set
------------------------------------
{
"reservation": "system.2",
"user_access_list": ["tom"]
}
5.227.2.D Modify QoS Credentials
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/qoses/<name>?api-version=3[&change-mode=<add|remove|set>]
See 5.217 Global URL Parameters for available URL parameters.
Sample body
PUT http://localhost:8080/mws/rest/credentials/qoses/special?api-version=3
------------------------------------
{
"max_processors": "5",
"max_processor_seconds": "500"
}
5.227.2.E Modify User Credentials
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/users/<name>?api-version=3[&change-mode=<add|remove|set>]
See 5.217 Global URL Parameters for available URL parameters.
Sample body
PUT http://localhost:8080/mws/rest/credentials/users/tom?api-version=3
------------------------------------
{
"email": "[email protected]"
}
Related Topics