nisystemlink.clients.core
- pydantic model nisystemlink.clients.core.ApiError[source]
Represents the standard error structure for SystemLink API responses.
Show JSON schema
{ "$ref": "#/definitions/ApiError", "definitions": { "ApiError": { "title": "ApiError", "description": "Represents the standard error structure for SystemLink API responses.", "type": "object", "properties": { "name": { "title": "Name", "type": "string" }, "code": { "title": "Code", "type": "integer" }, "message": { "title": "Message", "type": "string" }, "args": { "title": "Args", "default": [], "type": "array", "items": { "type": "string" } }, "resourceType": { "title": "Resourcetype", "type": "string" }, "resourceId": { "title": "Resourceid", "type": "string" }, "innerErrors": { "title": "Innererrors", "default": [], "type": "array", "items": { "$ref": "#/definitions/ApiError" } } } } } }
-
field args:
List
[str
] = [] Positional arguments for the error code.
-
field code:
Optional
[int
] = None Numeric error code.
-
field inner_errors:
List
[ApiError
] = [] Inner errors when the top-level error represents more than one error.
-
field message:
Optional
[str
] = None Complete error message.
-
field name:
Optional
[str
] = None String error code.
-
field resource_id:
Optional
[str
] = None Identifier of the resource associated with the error.
-
field resource_type:
Optional
[str
] = None Type of resource associated with the error.
- __init__(**data)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- classmethod construct(_fields_set=None, **values)
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
- Return type
Model
- copy(*, include=None, exclude=None, update=None, deep=False)
Duplicate a model, optionally choose which fields to include, exclude and change.
- Parameters
include (
Union
[AbstractSetIntStr, MappingIntStrAny,None
]) – fields to include in new modelexclude (
Union
[AbstractSetIntStr, MappingIntStrAny,None
]) – fields to exclude from new model, as with values this takes precedence over includeupdate (
Optional
[DictStrAny]) – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this datadeep (
bool
) – set to True to make a deep copy of the model
- Return type
Model
- Returns
new model instance
- dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- Return type
DictStrAny
- classmethod from_orm(obj)
- Return type
Model
- json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True, **dumps_kwargs)
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
- Return type
unicode
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)
- Return type
Model
- classmethod parse_obj(obj)
- Return type
Model
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)
- Return type
Model
- classmethod schema(by_alias=True, ref_template='#/definitions/{model}')
- Return type
DictStrAny
- classmethod schema_json(*, by_alias=True, ref_template='#/definitions/{model}', **dumps_kwargs)
- Return type
unicode
- classmethod update_forward_refs(**localns)
Try to update ForwardRefs on fields based on this Model, globalns and localns.
- Return type
None
- classmethod validate(value)
- Return type
Model
-
field args:
- exception nisystemlink.clients.core.ApiException(message=None, error=None, http_status_code=None, inner=None)[source]
Represents errors that occur when calling SystemLink APIs.
- __init__(message=None, error=None, http_status_code=None, inner=None)[source]
Initialize an exception.
- Parameters
message (
Optional
[str
]) – The message describing the error.error (
Optional
[nisystemlink.clients.core.ApiError
]) – The error returned by the API.http_status_code (
Optional
[int
]) – The HTTP status code, if this exception was the result of an HTTP error.inner (
Optional
[Exception
]) – The inner exception that caused the error.
- property error: Optional[ApiError]
The error information returned by the SystemLink API, or None if the API did not return one or the error occurred trying to call the API.
- property http_status_code: Optional[int]
The HTTP status code, if this exception was the result of an HTTP error.
- property inner_exception: Optional[Exception]
The exception that caused this failure, if any.
- property message: Optional[str]
The error message.
- with_traceback()
Exception.with_traceback(tb) – set self.to tb and return self.
- class nisystemlink.clients.core.CloudHttpConfiguration(api_key)[source]
An
HttpConfiguration
specifically for use with SystemLink Cloud.- DEFAULT_TIMEOUT_MILLISECONDS = 60000
The default value of
timeout_milliseconds
to use when making API calls.
- __init__(api_key)[source]
Initialize a configuration for SystemLink Cloud using API key-based authentication.
- Parameters
api_key (
str
) – The API key to send with requests.- Raises
ValueError – if
api_key
is empty.
- property api_keys: Optional[Dict[str, str]]
The available API keys to use for authorization, or None if none were provided.
- property cert_path: Optional[Path]
Local path to an SSL certificate file.
- property password: Optional[str]
The password to use for HTTP authentication, or None if none was provided.
- property server_uri: str
The
urllib.parse.urlparse().scheme
,urllib.parse.urlparse().hostname
, andurllib.parse.urlparse().port
of the web server hosting the SystemLink service to connect to.Additional Uri properties such as
urllib.parse.urlparse().path
andurllib.parse.urlparse().query
are ignored.
- property timeout_milliseconds: int
The number of milliseconds before a request times out with an error.
Changing the timeout will not affect APIs that have already read the configuration.
- property user_agent: Optional[str]
The string to pass the web server as the product name or names making the request, or None to use a library-specific default.
Changing the user-agent will not affect APIs that have already read the configuration.
- property username: Optional[str]
The username to use for HTTP authentication, or None if none was provided.
- class nisystemlink.clients.core.HttpConfiguration(server_uri, api_key=None, username=None, password=None, cert_path=None)[source]
Represents the configuration for accessing a SystemLink service over HTTP.
- DEFAULT_TIMEOUT_MILLISECONDS = 60000
The default value of
timeout_milliseconds
to use when making API calls.
- __init__(server_uri, api_key=None, username=None, password=None, cert_path=None)[source]
Initialize a configuration.
If neither
api_key
norusername
andpassword
are set, the configuration will use anonymous access, and any API calls that require authorization will fail.- Parameters
server_uri (
str
) – The scheme, host, and port (if not default) of the web server hosting the SystemLink service to connect to. Additional Uri properties such asurllib.parse.urlparse().path
andurllib.parse.urlparse().query
are ignored.api_key (
Optional
[str
]) – The API key to send with requests.username (
Optional
[str
]) – The name of the user to use when authorization is required.password (
Optional
[str
]) – The user’s password to use when authorization is required.cert_path (
Optional
[pathlib.Path
]) – Local path to an SSL certificate file.
- Raises
ValueError – if
server_uri
is missing scheme or host information.ValueError – if
username
orpassword
is set, but not both.
- property api_keys: Optional[Dict[str, str]]
The available API keys to use for authorization, or None if none were provided.
- property cert_path: Optional[Path]
Local path to an SSL certificate file.
- property password: Optional[str]
The password to use for HTTP authentication, or None if none was provided.
- property server_uri: str
The
urllib.parse.urlparse().scheme
,urllib.parse.urlparse().hostname
, andurllib.parse.urlparse().port
of the web server hosting the SystemLink service to connect to.Additional Uri properties such as
urllib.parse.urlparse().path
andurllib.parse.urlparse().query
are ignored.
- property timeout_milliseconds: int
The number of milliseconds before a request times out with an error.
Changing the timeout will not affect APIs that have already read the configuration.
- property user_agent: Optional[str]
The string to pass the web server as the product name or names making the request, or None to use a library-specific default.
Changing the user-agent will not affect APIs that have already read the configuration.
- property username: Optional[str]
The username to use for HTTP authentication, or None if none was provided.
- class nisystemlink.clients.core.HttpConfigurationManager[source]
Factory for
HttpConfiguration
objects.- HTTP_LOCALHOST_CONFIGURATION_ID = 'SYSTEMLINK_LOCALHOST'
The default ID of the SystemLink Server’s configuration on the SystemLink Server itself.
- HTTP_MASTER_CONFIGURATION_ID = 'SYSTEMLINK_MASTER'
The default ID of the SystemLink Server’s configuration on systems registered using SystemLink Client.
- classmethod get_configuration(id=None, enable_fallbacks=True)[source]
Get the requested or default configuration.
- Parameters
id (
Optional
[str
]) – The ID of the configuration to find.enable_fallbacks (
Optional
[bool
]) – Whether or not to fallback to other known configurations, ifid
is unavailable.
- Return type
- Returns
The configuration.
- Raises
ValueError – if
id
is None andenable_fallbacks
is False.ApiException – if the specified (or default) configuration is not found.
- class nisystemlink.clients.core.JupyterHttpConfiguration[source]
An
HttpConfiguration
for Jupyter notebooks running in a SystemLink environment.- DEFAULT_TIMEOUT_MILLISECONDS = 60000
The default value of
timeout_milliseconds
to use when making API calls.
- __init__()[source]
Initialize a configuration for SystemLink using API key-based authentication provided through environment variables.
- Raises
KeyError – if the expected environment variables are not set.
- property api_keys: Optional[Dict[str, str]]
The available API keys to use for authorization, or None if none were provided.
- property cert_path: Optional[Path]
Local path to an SSL certificate file.
- property password: Optional[str]
The password to use for HTTP authentication, or None if none was provided.
- property server_uri: str
The
urllib.parse.urlparse().scheme
,urllib.parse.urlparse().hostname
, andurllib.parse.urlparse().port
of the web server hosting the SystemLink service to connect to.Additional Uri properties such as
urllib.parse.urlparse().path
andurllib.parse.urlparse().query
are ignored.
- property timeout_milliseconds: int
The number of milliseconds before a request times out with an error.
Changing the timeout will not affect APIs that have already read the configuration.
- property user_agent: Optional[str]
The string to pass the web server as the product name or names making the request, or None to use a library-specific default.
Changing the user-agent will not affect APIs that have already read the configuration.
- property username: Optional[str]
The username to use for HTTP authentication, or None if none was provided.