Skip to content

Latest commit

 

History

History
943 lines (580 loc) · 16.6 KB

File metadata and controls

943 lines (580 loc) · 16.6 KB

Analytics Library REST API

Overview

The Analytics Library REST API is provided by the Analytics service. This API enables you to manage the libraries that are used to create SQL+\+ for Analytics user-defined functions.

Version information

Version: 0.1

Host information

{scheme}://{host}:{port}

The URL scheme, host, and port are as follows.

Component Description

scheme

The URL scheme. Use https for secure access.

Values: http, https

host

The host name or IP address of a node running the Analytics Service.

Example: localhost

port

The Analytics Service REST port. Use 18095 for secure access.

Values: 8095, 18095

Resources

This section describes the operations available with this REST API.

Delete a Library

DELETE /analytics/library/{scope}/{library}

Parameters

Path Parameters

Name Description Schema

library
required

The name of a library.

String

scope
required

The name of the Analytics scope containing the library.

The scope name may contain one or two identifiers, separated by a slash (/). You must URL-encode this parameter to escape any special characters.

String

Responses

HTTP Code Description Schema

200

The operation was successful.

Object

404

Not found. The library name in the path may be incorrect.

500

Internal server error. Incorrect path or port number, incorrect credentials, badly formatted parameters, or missing arguments.

Read All Libraries

GET /analytics/library

Responses

HTTP Code Description Schema

200

Success. Returns an array of objects, each of which contains information about a single library.

Libraries array

404

Not found. The path may be missing its trailing slash.

500

Internal server error. Incorrect path or port number, incorrect credentials, badly formatted parameters, or missing arguments.

Create or Update a Library

POST /analytics/library/{scope}/{library}

Description

Creates the specified library and its associated functions. If the specified library exists, the existing library is overwritten.

Consumes
  • multipart/form-data

Produces
  • application/json

Parameters

Path Parameters

Name Description Schema

library
required

The name of a library.

String

scope
required

The name of the Analytics scope containing the library.

The scope name may contain one or two identifiers, separated by a slash (/). You must URL-encode this parameter to escape any special characters.

String

Form Parameters

Name Description Schema

data
required

The library and all its dependencies, packaged by shiv.

File (binary)

type
required

The language of the library.

Values: "python"

String

Responses

HTTP Code Description Schema

200

The operation was successful.

Object

400

Bad request. A parameter has an incorrect value.

500

Internal server error. Incorrect path or port number, incorrect credentials, badly formatted parameters, or missing arguments.

Definitions

This section describes the properties consumed and returned by this REST API.

Libraries

[brackets curly] Object

Property Schema

scope
optional

The name of the Analytics scope containing the library.

The scope name may contain one or two identifiers, separated by a slash (/).

Example: "travel-sample/inventory"

String

hash_md5
optional

A MD5 hash of the library residing on the server.

String

name
optional

The name of the library.

Example: "mylib"

String

Security

Full Admin

To [Create or Update a Library](#post_library) or [Delete a Library](#delete_library), users must have the Full Admin RBAC role.

Type: http

Analytics Admin

To [Read All Libraries](#get_collection), users must have one of the following RBAC roles:

  • Full Admin

  • Cluster Admin

  • Analytics Admin

Type: http