- Usage Instructions
- Listing all scopes (Auth Enabled, TLS Disabled)
- Creating a new Scope
- Add a Stream to a Scope
- Listing Streams of a Scope
-
Replace parameters contained in brackets (
{{ }}
) with your values applicable to your own environment. For example, for listing all scopes, here's a sample endpoint for a TLS-enabled Controller endpoint.- Generic:
{{protocol}}://{{hostname}}:{{port}}/v1/scopes
- Specific:
https://localhost:9091/v1/scopes
- Generic:
-
Depending on the tool you use and the AuthHandler implementation, use the appropriate command. For example, if you are using
curl
and the default PasswordAuthHandler for authentication which uses basic authentication, the commands for listing scopes may be as follows:
-
TLS and auth enabled, with the signing CA certificate not trusted on the client host:
$ curl -v -k -u admin:1111_aaaa https://localhost:9091/v1/scopes
Note that this was a GET request, so there's no request body. Also, see curl documentation to understand the flags.
-
TLS disabled, auth enabled:
$ curl -v -u admin:1111_aaaa http://localhost:9091/v1/scopes
-
Both TLS and auth disabled:
$ curl -v http://localhost:9091/v1/scopes
GET {{protocol}}://{{hostname}}:{{port}}/v1/scopes
Headers:
Authorization: Basic YWRtaW46MTExMV9hYWFh
Ex: GET http://localhost:9091/v1/scopes
Status: 200 OK
Response Body:
{"scopes":[{"scopeName":"_system"}]}
POST {{protocol}}://{{hostname}}:{{port}}/v1/scopes
Ex: POST http://localhost:9091/v1/scopes
Headers:
Authorization: Basic YWRtaW46MTExMV9hYWFh
Content-Type: application/json
Accept: application/json
Request Body:
{
"scopeName": "org.example.myscope"
}
Status: 201 Created
Response Body:
{
"scopeName": "org.example.myscope"
}
POST {{protocol}}://{{hostname}}:{{port}}/v1/scopes/{{myscope}}/streams
Ex: POST http://localhost:9091/v1/scopes/org.example.myscope/streams
Headers:
Authorization: Basic YWRtaW46MTExMV9hYWFh
Content-Type: application/json
Accept: application/json
Request Body:
{
"streamName" : "mystream",
"scalingPolicy" : {
"type" : "FIXED_NUM_SEGMENTS",
"targetRate" : 0,
"scaleFactor" : 0,
"minSegments" : 1
}
}
Status: 201 Created
Response Body:
{
"scopeName": "org.example.myscope",
"streamName": "mystream",
"scalingPolicy": {
"type": "FIXED_NUM_SEGMENTS",
"minSegments": 1
}
}
GET {{protocol}}://{{hostname}}:{{port}}/v1/scopes/{{myscope}}/streams/
Ex: GET http://localhost:9091/v1/scopes/org.example.myscope/streams
Headers:
Authorization: Basic YWRtaW46MTExMV9hYWFh
Status: 200 OK
Response Body:
{
"streams": [
{
"scopeName": "org.example.myscope",
"streamName": "mystream2",
"scalingPolicy": {
"type": "FIXED_NUM_SEGMENTS",
"minSegments": 1
}
},
{
"scopeName": "org.example.myscope",
"streamName": "mystream",
"scalingPolicy": {
"type": "FIXED_NUM_SEGMENTS",
"minSegments": 1
}
}
]