Client Constructor

On This Page

Description

All Frames operations are executed via an object of the Client class, which is created by using the Client constructor.

Syntax

Client(address="", container=""[, data_url="", user="", password="", token=""])

Parameters and Data Members

address | container | data_url | password | token | user

address
The address of the Frames service.
When running locally on the platform, set this parameter to "framesd:8081" for a gRPC client (recommended) or to "http://framesd:8080" for an HTTP client. (In the platform Jupyter Notebook and web-shell services, the gRPC and HTTP port numbers of the Frames service are stored in predefined FRAMESD_SERVICE_PORT_GRPC and FRAMESD_SERVICE_PORT environment variables, respectively.)
When connecting to the platform remotely, set this parameter to the API address of a Frames platform service in the parent tenant. You can copy this address from the API column of the V3IO Frames service on the Services dashboard page.

  • Type: str
  • Requirement: Required
container
The name of the data container that contains the backend data. For example, "bigdata" or "users".

  • Type: str
  • Requirement: Required
data_url
A web-API base URL for accessing the backend data. By default, the client uses the data URL that’s configured for the Frames service, which is typically the HTTPS URL of the web-APIs service of the parent tenant.

  • Type: str
  • Requirement: Optional
token
A valid platform access key that allows access to the backend data. See User Authentication.

  • Type: str
  • Requirement: Required when neither the user or password parameters or the authentication environment variables are set.
user
The username of a platform user with permissions to access the backend data. See User Authentication.

  • Type: str
  • Requirement: Required when neither the token parameter or the authentication environment variables are set.
    When the user parameter is set, the password parameter must also be set to a matching user password.
password

A platform password for the user configured in the user parameter. See User Authentication.

  • Type: str
  • Requirement: Required when the user parameter is set.

Return Value

Returns a new Frames Client object.

Examples

The following example, for local platform execution creates a Frames client for accessing data in the “users” data container. The identity of the user is authenticated by setting the token parameter of the Client constructor to a platform access key:

import v3io_frames as v3f
client = v3f.Client("framesd:8081", container="users", token="e8bd4ca2-537b-4175-bf01-8c74963e90bf")

The following example is similar to the previous exactly except that the identity of the user is authenticated by setting the user and password parameters of the Client constructor to the name of a platform user and the matching password:

import v3io_frames as v3f
client = v3f.Client("framesd:8081", container="users, user="iguazio", password="mypass")

See Also