Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
482 lines (280 sloc) 9.73 KB

RESTinTSM - a RESTful API for IBM TSM

General

Methods

  • POST to create new information
  • GET to read/retrieve information
  • PUT to update (existing) information
  • DELETE to delete (existing) information

Data formats

  • API input should be formatted as JSON.
  • API output is depending on content negotiation (Accept header).

Authentication

  • Plain HTTP Basic Authentication may be used for GET operations.
  • All operations (GET/POST/PUT/DELETE) may be authenticated using an Authorization header of type Token (similar to HTTP Basic Authentication, with "Basic" replaced with "Token").
  • Use access key indentifier as username and secret access key as password.

Domains

Domains have a fully qualified domain name (e.g. 'example.com'), as well as a shorter domain tag (e.g. 'example') and a description. Each domain is assigned zero or more TSM servers.

List All Domains

Resource

GET https://hostname/tsm/v1/domains

Response

Returns a list of href, domain and tag for all domains.

View Domain

Resource

GET https://hostname/tsm/v1/domains/DOMAIN

Response

Returns a 200 OK response containing the following information:

  • domain - fully qualified domain name (e.g., 'example.com')
  • tag - short version of the domain name (e.g. 'example')
  • description - domain description
  • servers - list of TSM servers
  • deduplication - percent of data not stored due to deduplication (weighted average across all TSM servers used by the domain)

Create Domain

Resource

POST https://hostname/tsm/v1/domains

Request

Required Parameters:

  • domain - fully qualified domain name (e.g., 'example.com')
  • tag - short version of the domain name (e.g. 'example')
  • description - domain description

Optional Parameters:

  • servers

Response

Returns a 201 Created response, with a Location header pointing to the created resources.

Delete Domain

Resource

DELETE https://hostname/tsm/v1/domains/DOMAIN

Update Domain

Resource

PUT https://hostname/tsm/v1/domains/DOMAIN

Request

Optional Parameters:

  • description - domain description
  • servers - list of TSM servers

Users

List All Users

List all users or users in a single domain. Optionally display domain administrators only.

Resource

GET https://hostname/tsm/v1/users
GET https://hostname/tsm/v1/domains/DOMAIN/users
GET https://hostname/tsm/v1/domains/DOMAIN/users?admin_domain=1

Response

Returns a list of href, domain and identity for all users.

View User

Resource

GET https://hostname/tsm/v1/users/IDENTITY

Response

Returns a 200 OK response containing the following information:

  • identity - federated identity
  • domain - fully qualified domain name (e.g., 'example.com')
  • authorized_keys
  • cost_centers - list of cost centers users is authorized to use
  • admin_global - user is global administrator
  • admin_domain - user is domain administrator

Create User

Resource

POST https://hostname/tsm/v1/users

Request

Required Parameters:

  • identity - federated identity

Optional Parameters:

  • cost_centers - list of cost centers users is authorized to use
  • admin_global - user is global administrator
  • admin_domain - user is domain administrator

Response

Returns a 201 Created response, with a Location header pointing to the created resources.

Delete User

Resource

DELETE https://hostname/tsm/v1/users/IDENTITY

Request

Response

Update User

Resource

PUT https://hostname/tsm/v1/users/IDENTITY

Request

Optional Parameters:

  • cost_centers - list of cost centers users is authorized to use
  • admin_global - set if user is global administrator
  • admin_domain - set if user is domain administrator

Keys

List All Keys

Resource

GET https://hostname/tsm/v1/keys
GET https://hostname/tsm/v1/users/IDENTITY/keys

Response

View Key

Resource

GET https://hostname/tsm/v1/keys/ACCESS-KEY-ID

Response

  • access_key_id
  • identity - federated identity
  • description - key description
  • impersonator - key may be used to impersonate anyone
  • readonly - key may only be used to read information
  • enroller - key may only be used to enroll nodes
  • enroller_count - key is limited to enroll this may nodes

Create Key

Resource

POST https://hostname/tsm/v1/keys

Request

Optional Parameters:

  • description - key description
  • readonly - key may only be used to read information
  • enroller - key may only be used to enroll nodes
  • enroller_count - key is limited to enroll this may nodes

Response

Returns a 201 Created response, with a Location header pointing to the created resources, as well as the following data:

  • access_key_id
  • secret_access_key

Delete Key

Resource

DELETE https://hostname/tsm/v1/keys/ACCESS-KEY-ID

Request

Response

Nodes

List All Nodes

List all nodes, nodes in a specific domain or nodes owned by a specific user. Optionally filter by hostname.

Resource

GET https://hostname/tsm/v1/nodes
GET https://hostname/tsm/v1/nodes?hostname=HOSTNAME
GET https://hostname/tsm/v1/users/IDENTITY/nodes
GET https://hostname/tsm/v1/users/IDENTITY/nodes?hostname=HOSTNAME
GET https://hostname/tsm/v1/domains/DOMAIN/nodes
GET https://hostname/tsm/v1/domains/DOMAIN/nodes?hostname=HOSTNAME

Response

View Node

Resource

GET https://hostname/tsm/v1/nodes/NODENAME

Response

  • nodename - TSM nodename
  • hostname - node hostname
  • mail - email address of node contact
  • description - node description
  • identity - node owner identity
  • domain - node domain
  • server - TSM server
  • platform - node platform (operating system)
  • application - node application (use)
  • cost_center - node cost center
  • locked_by_user - node is locked by the user
  • locked_by_service - node is locked by the provider
  • encryption - data should be encrypted before backup
  • deduplication - data deduplication is enabled
  • compression - data compression is enabled
  • allow_backup_delete - backup delete allowed
  • activated - node has ever contacted the server
  • schedules - list of associated backup schedules
  • policy - node backup policy
  • last_hostname - Last hostname reported via TSM
  • last_ip_address - Last IP address reported via TSM
  • last_mac_address - Last MAC address reported via TSM
  • last_access_time - Last known contact reported via TSM

Create Node

Resource

POST https://hostname/tsm/v1/nodes

Request

Required Parameters:

  • cost_center - node cost center

Optional Parameters:

  • hostname - node hostname
  • mail - email address of node contact
  • description - node description
  • encryption - data should be encrypted before backup
  • deduplication - data deduplication is enabled
  • compression - data compression is enabled
  • allow_backup_delete - backup delete allowed
  • platform - node platform (operating system)
  • application - node application (use)

Response

Returns a 201 Created response, with a Location header pointing to the created resources.

  • nodename - TSM nodename
  • password - TSM password
  • server - TSM server

Delete Node

Resource

DELETE https://hostname/tsm/v1/nodes/NODENAME

Request

Response

Update Node

Resource

PUT https://hostname/tsm/v1/nodes/NODENAME

Request

Optional Parameters:

  • identity - node owner identity
  • schedules - list of associated backup schedules
  • policy - node backup policy
  • hostname - node hostname
  • mail - email address of node contact
  • platform - node platform (operating system)
  • description - node description
  • cost_center - node cost center
  • locked_by_user - node is locked by the user
  • locked_by_service - node is locked by the provider
  • allow_backup_delete - backup delete allowed

Response

Request Node Rekeying

Resource

POST https://hostname/tsm/v1/nodes/NODENAME/rekey

Request

Response

  • nodename - TSM nodename
  • password - TSM password

Get Node TSM Configuration

Resource

GET https://hostname/tsm/v1/nodes/NODENAME/config

Request

Response

An zip archive (application/zip) containing TSM configuration for the node.

Get Node TSM Software

Resource

GET https://hostname/tsm/v1/nodes/NODENAME/software

Request

Response

A file containing TSM software for the node.

Get Possible Node Schedules

Resource

GET https://hostname/tsm/v1/nodes/NODENAME/schedules

Request

Response

  • name - schedule name
  • description - schedule description

Get Possible Node Backup Policies

Resource

GET https://hostname/tsm/v1/nodes/NODENAME/policies

Request

Response

  • name - backup policy name
  • description - backup policy description

Platforms

List All Platforms

Resource

GET https://hostname/tsm/v1/platforms

Response

  • name - platform name
  • description - platform description

Applications

List All Applications

Resource

GET https://hostname/tsm/v1/applications

Response

  • name - application name
  • description - application description

Servers

List All Servers

Resource

GET https://hostname/tsm/v1/servers

Response

  • hostname - server hostname (FQDN)
  • description - server description
  • utilization - percent full (of maximum capacity)