Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Microservices Conventions

In this API, client refers to an external application that is calling CDAP using the HTTP interface. application refers to a user application that has been deployed into CDAP.

Base URL

All URLs referenced in these APIs have this base URL:

...

Code Block
$ curl -w"\n" -X PUT "http://localhost:11015/v3/namespaces/default/apps/who"

Variable Replacement

Text that are variables that you are to replace is indicated by a series of angle brackets (< >). For example:

...

Code Block
PUT /v3/namespaces/default/apps/<myapp>

Reserved and Unsafe Characters

In path parameters, reserved and unsafe characters must be replaced with their equivalent percent-encoded format, using the "%hh" syntax, as described in RFC3986: Uniform Resource Identifier (URI): Generic Syntax.

...

Additionally, there are further restrictions on the characters used in certain parameters such as namespaces.

Names and Characters for Namespace Identifiers

Namespaces have a limited set of characters allowed in their identifier; they are restricted to letters (a-z, A-Z), digits (0-9), hyphens (-), and underscores (_). There is no size limit on the length of a namespace identifier nor on the number of namespaces.

...

All reserved namespaces cannot be deleted.

Microservices Status Codes

Common status codes returned for all HTTP calls:

...

Note: These returned status codes are not necessarily included in the descriptions of the APIs, but a request may return any of these.

Working with CDAP Security

  • When working with a CDAP cluster with security enabled (security.enabled=true in cdap-site.xml), all calls to the HTTP RESTful APIs must be authenticated. Clients must first obtain an access token from the authentication server (see Client Authentication). In order to authenticate, all client requests must supply this access token in the Authorization header of the request:

    Code Block
    Authorization: Bearer <token>

    For CDAP-issued access tokens, the authentication scheme must always be Bearer.

  • When working with a CDAP cluster with authorization enabled (security.authorization.enabled=true in cdap-site.xml), all calls to the HTTP RESTful APIs must be authorized. Clients must be privileged, following the polices described in Authorization Policies.