# Account Rest API

Overview

Resource | Operation | Description
--- | --- | ---
Account | GET /accounts/ | List all accounts.
AccountLimits | GET /accounts/(account)/limits/(rse) | Get account limits.
| GET /accounts/(account)/limits |
AccountParameter | PUT /accounts/(account) | Update account information.
| POST /accounts/(account) | Add account.
| GET /accounts/(account) | Get account parameters.
| DELETE /accounts/(account) | Delete account information.
Attributes | POST /accounts/(account)/attr/(key) | Add account attribute
| GET /accounts/(account)/attr | list account attributes.
| DELETE /accounts/(account)/attr/(key) | Delete account attribute
Identities | POST /accounts/(account)/identities | Add identity to account.
| GET /accounts/(account)/identities | Get account idenitity mapping.
| DELETE /accounts/(account)/identities | Remove identity from account.
Rules | GET /accounts/(account)/rules | Get rules for account.
Scope | POST /accounts/(account)/scopes/(scope) | Add to account.
Scopes | GET /accounts/(account)/scopes | List scope for account.
Usage1 | GET /accounts/(account)/usage | Get account usage.
Usage2 | GET /accounts/(account)/usage/(rse) | Get account usage for RSE.

Details

`GET` `/accounts/`

  list all rucio accounts.

  Response Headers:
  | Content-Type – application/x-json-stream
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 500 Internal Server Error – Database exception
  Returns: | A list containing all account names as dict.

`POST` `/accounts/`(account)`/identities`

  Grant an identity access to an account.

  Parameters: | account – Account identifier.
  Request JSON Object:
  | identity (string) – The identity name. authtype (string) – The auth type of the identity. email (string) – The email address.
  Status Codes: | 201 Created – Successfully added. 400 Bad Request – Parameter missing. 401 Unauthorized – Invalid auth token. 409 Conflict – Already exists. 404 Not Found – Account not found. 500 Internal Server Error – Database exception.

`GET` `/accounts/`(account)`/identities`

  Get all identities mapped to an account.

  Response Headers:
  | Content-Type – application/x-json-stream
  Parameters: | account – The account identifier.
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 500 Internal Server Error – Database exception
  Returns: | Line separated dicts of identities.

`DELETE` `/accounts/`(account)`/identities`

  Delete an account’s identity mapping.

  Parameters: | account – Account identifier.
  Request JSON Object:
  | identity (string) – The identity name. authtype (string) – The authentication type.
  Status Codes: | 200 OK – Successfully deleted. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 404 Not Found – Identity not found. 500 Internal Server Error – Database exception.

`POST` `/accounts/`(account)`/scopes/`(scope)

  create scope with given scope name.

  Parameters: | account – The account identifier. scope – The scope to be added.
  Status Codes: | 201 Created – Successfully added. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 409 Conflict – Scope already exists. 500 Internal Server Error – Database exception.

`GET` `/accounts/`(account)`/scopes`

  list all scopes for an account.

  Parameters: | account – The account identifier.
  Response Headers:
  | Content-Type – application/x-json-stream
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 404 Not Found – Scope not found. 500 Internal Server Error – Database exception.
  Returns: | A list containing all scope names for an account.

`GET` `/accounts/`(account)`/limits/`(rse)

`GET` `/accounts/`(account)`/limits`

  get the current limits for an account on a specific RSE

  Parameters: | account – The account name. rse – The rse name.
  Response Headers:
  | Content-Type – application/json
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – RSE not found. 500 Internal Server Error – Database exception
  Returns: | JSON dict containing informations about the requested user.

`GET` `/accounts/`(account)`/usage/`(rse)

  Return the account usage of the account.

  Parameters: | account – The account name. rse – The rse.
  Response Headers:
  | Content-Type – application/x-json-stream
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 404 Not Found – RSE not found. 500 Internal Server Error – Database exception.
  Returns: | Line separated list of account usages.

`GET` `/accounts/`(account)`/rules`

  Return all rules of a given account.

  Parameters: | scope – The scope name.
  Response Headers:
  | Content-Type – application/x-json-stream
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – Rule not found. 500 Internal Server Error – Database exception.
  Returns: | Line separated list of rules.

`GET` `/accounts/`(account)`/usage`

  Return the account usage of the account.

  Parameters: | account – The account name.
  Response Headers:
  | Content-Type – application/x-json-stream
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 500 Internal Server Error – Database exception.
  Returns: | Line separated list of account usages.

`POST` `/accounts/`(account)`/attr/`(key)

  Add attributes to an account.

  Parameters: | account – Account identifier. key – The attribute key.
  Request JSON Object:
  | key (string) – The attribute key. value (string) – The attribute value.
  Status Codes: | 201 Created – Successfully created. 401 Unauthorized – Invalid auth token. 409 Conflict – Attribute already exists. 404 Not Found – Account not found. 500 Internal Server Error – Database Exception.

`GET` `/accounts/`(account)`/attr`

  list all attributes for an account.

  Parameters: | account – The account identifier.
  Response Headers:
  | Content-Type – application/json
  Status Codes: | 200 OK – OK 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 500 Internal Server Error – Database Exception.
  Returns: | JSON dict containing informations about the requested account.

`DELETE` `/accounts/`(account)`/attr/`(key)

  Remove attribute from account.

  Parameters: | account – Account identifier. key – The attribute key.
  Status Codes: | 200 OK – Successfully deleted. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 500 Internal Server Error – Database Exception.

`PUT` `/accounts/`(account)

  update the status for a given account name

  Parameters: | account – The account identifier.
  Status Codes: | 200 OK – OK. 400 Bad Request – Unknown status. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 500 Internal Server Error – Database exception.

`POST` `/accounts/`(account)

  create account with given account name.

  Parameters: | account – The account identifier.
  Request JSON Object:
  | type (string) – The account type. email (string) – The account email.
  Status Codes: | 201 Created – Successfully created. 401 Unauthorized – Invalid auth token. 409 Conflict – Account already exists. 500 Internal Server Error – Database exception.

`GET` `/accounts/`(account)

  get account parameters for given account name.

  Parameters: | account – The account identifier.
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 500 Internal Server Error – Database exception.
  Returns: | JSON dict containing informations about the requested user.

`DELETE` `/accounts/`(account)

  disable account with given account name.

  Parameters: | account – The account identifier.
  Status Codes: | 200 OK – OK. 401 Unauthorized – Invalid auth token. 404 Not Found – Account not found. 500 Internal Server Error – Database exception.