qiskit_serverless.core.ServerlessClient

class ServerlessClient(name=None, host=None, version=None, token=None, verbose=False)[source]

A client for connecting to a specified host.

Example

>>> client = ServerlessClient(
>>>    name="<NAME>",
>>>    host="<HOST>",
>>>    token="<TOKEN>",
>>> )

Initializes the ServerlessClient instance.

Parameters:
  • name (Optional[str]) – name of client

  • host (Optional[str]) – host of gateway

  • version (Optional[str]) – version of gateway

  • token (Optional[str]) – authorization token

__init__(name=None, host=None, version=None, token=None, verbose=False)[source]

Initializes the ServerlessClient instance.

Parameters:
  • name (Optional[str]) – name of client

  • host (Optional[str]) – host of gateway

  • version (Optional[str]) – version of gateway

  • token (Optional[str]) – authorization token

Methods

__init__([name, host, version, token, verbose])

Initializes the ServerlessClient instance.

context(**kwargs)

Allocated context for selected compute_resource for provider.

create_compute_resource(resource)

Create compute resource for provider.

delete_compute_resource(resource)

Delete compute resource for provider.

download(file[, download_location])

Download file.

file_delete(file[, provider])

Deletes file uploaded or produced by the programs,

file_download(file[, target_name, ...])

Download file.

file_upload(file[, provider])

Upload file.

files([provider])

Returns list of available files produced by programs to download.

from_dict(dictionary)

Converts dict to object.

get(title[, provider])

Returns qiskit function based on title provided.

get_compute_resources()

Return compute resources for provider.

get_job_by_id(job_id)

Returns job by job id.

get_jobs(**kwargs)

Return list of jobs.

get_programs(**kwargs)

[Deprecated] Returns list of available programs.

job_client()

Return job client for configured compute resource of provider.

list(**kwargs)

Returns list of available programs.

run(program[, arguments, config])

Execute a program as a async job.

to_dict()

Converts class to dict.

upload(program)

Uploads program.

widget()

Widget for information about provider and jobs.