(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 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 | -- | -- |
This topic contains these sections:
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
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/accounts?api-version=3
See 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",
"user_access_list": ["adaptive"]
}
] }
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/accounts/<name>?api-version=3
See 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"]
}
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/classes?api-version=3
See 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",
"user_access_list": ["adaptive"]
} ] }
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/classes/<name>?api-version=3
See 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",
"user_access_list": ["adaptive"]
}
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/groups/<name>?api-version=3
See 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",
"user_access_list": ["adaptive"]
}
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/groups/<name>?api-version=3
See 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",
"user_access_list": ["adaptive"]
}
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/qoses?api-version=3
See 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",
"user_access_list": ["adaptive"],
"flags": [
"DEADLINE",
"RESERVEALWAYS",
"DEDICATED"
]
"queue_time_weight": 30,
"expansion_factor_weight": 40,
"quality_of_service_priority": 20
}
] }
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/qoses/<name>?api-version=3
See 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",
"user_access_list": ["adaptive"]
"flags": [
"DEADLINE",
"RESERVEALWAYS",
"DEDICATED"
]
"queue_time_weight": 30,
"expansion_factor_weight": 40,
"quality_of_service_priority": 20
}
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/users?api-version=3
See 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]"
}
] }
URLs and parameters
GET http://localhost:8080/mws/rest/credentials/users/<name>?api-version=3
See 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]"
}
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.
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/accounts/<name>?api-version=3[&change-mode=<add|remove|set>]
See 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
}
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/classes/<name>?api-version=3[&change-mode=<add|remove|set>]
See 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
}
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/groups/<name>?api-version=3[&change-mode=<add|remove|set>]
See 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"]
}
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/qoses/<name>?api-version=3[&change-mode=<add|remove|set>]
See 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
}
URLs and parameters
PUT http://localhost:8080/mws/rest/credentials/users/<name>?api-version=3[&change-mode=<add|remove|set>]
See 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