INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Update an object on the server.
def update(self, id=None, new_data={}, **kwargs): """Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns...
Download the archive of a project export.
def download(self, streamed=False, action=None, chunk_size=1024, **kwargs): """Download the archive of a project export. Args: streamed (bool): If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for reatment ...
Return a list of files in the repository.
def repository_tree(self, path='', ref='', recursive=False, **kwargs): """Return a list of files in the repository. Args: path (str): Path of the top folder (/ by default) ref (str): Reference to a commit or branch recursive (bool): Whether to get the tree recursivel...
Return a file by blob SHA.
def repository_blob(self, sha, **kwargs): """Return a file by blob SHA. Args: sha(str): ID of the blob **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: I...
Return a diff between two branches/ commits.
def repository_compare(self, from_, to, **kwargs): """Return a diff between two branches/commits. Args: from_(str): Source branch/SHA to(str): Destination branch/SHA **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenti...
Return a list of contributors for the project.
def repository_contributors(self, **kwargs): """Return a list of contributors for the project. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts wit...
Create a forked from/ to relation between existing projects.
def create_fork_relation(self, forked_from_id, **kwargs): """Create a forked from/to relation between existing projects. Args: forked_from_id (int): The ID of the project that was forked from **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
Delete a forked relation between existing projects.
def delete_fork_relation(self, **kwargs): """Delete a forked relation between existing projects. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the ser...
Delete merged branches.
def delete_merged_branches(self, **kwargs): """Delete merged branches. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to perform the ...
Get languages used in the project with percentage value.
def languages(self, **kwargs): """Get languages used in the project with percentage value. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server faile...
Share the project with a group.
def share(self, group_id, group_access, expires_at=None, **kwargs): """Share the project with a group. Args: group_id (int): ID of the group. group_access (int): Access level for the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
Delete a shared project link within a group.
def unshare(self, group_id, **kwargs): """Delete a shared project link within a group. Args: group_id (int): ID of the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
Trigger a CI build.
def trigger_pipeline(self, ref, token, variables={}, **kwargs): """Trigger a CI build. See https://gitlab.com/help/ci/triggers/README.md#trigger-a-build Args: ref (str): Commit to build; can be a branch name or a tag token (str): The trigger token variables ...
Start the housekeeping task.
def housekeeping(self, **kwargs): """Start the housekeeping task. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabHousekeepingError: If the server failed to perform the...
Upload the specified file into the project.
def upload(self, filename, filedata=None, filepath=None, **kwargs): """Upload the specified file into the project. .. note:: Either ``filedata`` or ``filepath`` *MUST* be specified. Args: filename (str): The name of the file being uploaded filedata (bytes):...
Return a snapshot of the repository.
def snapshot(self, wiki=False, streamed=False, action=None, chunk_size=1024, **kwargs): """Return a snapshot of the repository. Args: wiki (bool): If True return the wiki repository streamed (bool): If True the data will be processed by chunks of ...
Search the project resources matching the provided string.
def search(self, scope, search, **kwargs): """Search the project resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabA...
Start the pull mirroring process for the project.
def mirror_pull(self, **kwargs): """Start the pull mirroring process for the project. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server failed ...
Transfer a project to the given namespace ID
def transfer_project(self, to_namespace, **kwargs): """Transfer a project to the given namespace ID Args: to_namespace (str): ID or path of the namespace to transfer the project to **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
Import a project from an archive file.
def import_project(self, file, path, namespace=None, overwrite=False, override_params=None, **kwargs): """Import a project from an archive file. Args: file: Data or file object containing the project path (str): Name and path for the new project ...
List all the runners.
def all(self, scope=None, **kwargs): """List all the runners. Args: scope (str): The scope of runners to show, one of: specific, shared, active, paused, online all (bool): If True, return all the items, without pagination per_page (int): Number of ite...
Validates authentication credentials for a registered Runner.
def verify(self, token, **kwargs): """Validates authentication credentials for a registered Runner. Args: token (str): The runner's authentication token **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
Mark the todo as done.
def mark_as_done(self, **kwargs): """Mark the todo as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the request ...
Mark all the todos as done.
def mark_all_as_done(self, **kwargs): """Mark all the todos as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the requ...
Get the status of the geo node.
def status(self, **kwargs): """Get the status of the geo node. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server failed to perform the request ...
Retrieve a single object.
def get(self, id, lazy=False, **kwargs): """Retrieve a single object. Args: id (int or str): ID of the object to retrieve lazy (bool): If True, don't request the server, but create a shallow object giving access to the managers. This is ...
Retrieve a single object.
def get(self, id=None, **kwargs): """Retrieve a single object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns: object: The generated RESTObject Raises: GitlabAuthenticationError: If authentication is not correct ...
Refresh a single object from server.
def refresh(self, **kwargs): """Refresh a single object from server. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns None (updates the object) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError...
Retrieve a list of objects.
def list(self, **kwargs): """Retrieve a list of objects. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool): ...
Create a new object.
def create(self, data, **kwargs): """Create a new object. Args: data (dict): parameters to send to the server to create the resource **kwargs: Extra options to send to the server (e.g. sudo) Returns: RESTObject: a new instance of the...
Return the HTTP method to use.
def _get_update_method(self): """Return the HTTP method to use. Returns: object: http_put (default) or http_post """ if getattr(self, '_update_uses_post', False): http_method = self.gitlab.http_post else: http_method = self.gitlab.http_put ...
Update an object on the server.
def update(self, id=None, new_data={}, **kwargs): """Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns...
Create or update the object.
def set(self, key, value, **kwargs): """Create or update the object. Args: key (str): The key of the object to create/update value (str): The value to set for the object **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuth...
Delete an object on the server.
def delete(self, id, **kwargs): """Delete an object on the server. Args: id: ID of the object to delete **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteErro...
Save the changes made to the object to the server.
def save(self, **kwargs): """Save the changes made to the object to the server. The object is updated to match what the server returns. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raise: GitlabAuthenticationError: If authentication is not co...
Get the user agent detail.
def user_agent_detail(self, **kwargs): """Get the user agent detail. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request ...
Approve an access request.
def approve(self, access_level=gitlab.DEVELOPER_ACCESS, **kwargs): """Approve an access request. Args: access_level (int): The access level for the user **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
Create a todo associated to the object.
def todo(self, **kwargs): """Create a todo associated to the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the todo cannot be set """ ...
Get time stats for the object.
def time_stats(self, **kwargs): """Get time stats for the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tracking update cannot ...
Set an estimated time of work for the object.
def time_estimate(self, duration, **kwargs): """Set an estimated time of work for the object. Args: duration (str): Duration in human format (e.g. 3h30) **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
Resets estimated time for the object to 0 seconds.
def reset_time_estimate(self, **kwargs): """Resets estimated time for the object to 0 seconds. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the...
Resets the time spent working on the object.
def reset_spent_time(self, **kwargs): """Resets the time spent working on the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tra...
List the participants.
def participants(self, **kwargs): """List the participants. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool...
Preview link_url and image_url after interpolation.
def render(self, link_url, image_url, **kwargs): """Preview link_url and image_url after interpolation. Args: link_url (str): URL of the badge link image_url (str): URL of the badge image **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
Create a Gitlab connection from configuration files.
def from_config(cls, gitlab_id=None, config_files=None): """Create a Gitlab connection from configuration files. Args: gitlab_id (str): ID of the configuration section. config_files list[str]: List of paths to configuration files. Returns: (gitlab.Gitlab): A...
Performs an authentication.
def auth(self): """Performs an authentication. Uses either the private token, or the email/password pair. The `user` attribute will hold a `gitlab.objects.CurrentUser` object on success. """ if self.private_token or self.oauth_token: self._token_auth() ...
Returns the version and revision of the gitlab server.
def version(self): """Returns the version and revision of the gitlab server. Note that self.version and self.revision will be set on the gitlab object. Returns: tuple (str, str): The server version and server revision. ('unknown', 'unknwown') i...
Validate a gitlab CI configuration.
def lint(self, content, **kwargs): """Validate a gitlab CI configuration. Args: content (txt): The .gitlab-ci.yml content **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
Render an arbitrary Markdown document.
def markdown(self, text, gfm=False, project=None, **kwargs): """Render an arbitrary Markdown document. Args: text (str): The markdown text to render gfm (bool): Render text using GitLab Flavored Markdown. Default is False project (str): Full path of a...
Add a new license.
def set_license(self, license, **kwargs): """Add a new license. Args: license (str): The license string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabPostError:...
Returns the full url from path.
def _build_url(self, path): """Returns the full url from path. If path is already a url, return it unchanged. If it's a path, append it to the stored url. Returns: str: The full URL """ if path.startswith('http://') or path.startswith('https://'): ...
Make an HTTP request to the Gitlab server.
def http_request(self, verb, path, query_data={}, post_data=None, streamed=False, files=None, **kwargs): """Make an HTTP request to the Gitlab server. Args: verb (str): The HTTP method to call ('get', 'post', 'put', 'delete') path (st...
Make a GET request to the Gitlab server.
def http_get(self, path, query_data={}, streamed=False, raw=False, **kwargs): """Make a GET request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Dat...
Make a GET request to the Gitlab server for list - oriented queries.
def http_list(self, path, query_data={}, as_list=None, **kwargs): """Make a GET request to the Gitlab server for list-oriented queries. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data t...
Make a POST request to the Gitlab server.
def http_post(self, path, query_data={}, post_data={}, files=None, **kwargs): """Make a POST request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): D...
Make a PUT request to the Gitlab server.
def http_put(self, path, query_data={}, post_data={}, files=None, **kwargs): """Make a PUT request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data...
Search GitLab resources matching the provided string.
def search(self, scope, search, **kwargs): """Search GitLab resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthen...
Calls the callback_func passing in the two positional arguments conditionally waiting if the callback function hasn t been set yet. Meant to be run in a threadpool owned by the FutureCollection.
def run_callback(self): """Calls the callback_func, passing in the two positional arguments, conditionally waiting if the callback function hasn't been set yet. Meant to be run in a threadpool owned by the FutureCollection. Returns: None """ if self._callbac...
Adds a send_message function to the Dispatcher s dictionary of functions indexed by connection.
def add_send_message(self, connection, send_message): """Adds a send_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. send_message...
Adds a send_last_message function to the Dispatcher s dictionary of functions indexed by connection.
def add_send_last_message(self, connection, send_last_message): """Adds a send_last_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. ...
Removes a send_message function previously registered with the Dispatcher.
def remove_send_message(self, connection): """Removes a send_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages. """ if connection in self._send_message:...
Removes a send_last_message function previously registered with the Dispatcher.
def remove_send_last_message(self, connection): """Removes a send_last_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages. """ if connection in self._sen...
Sets PREPROCESSOR to run on MESSAGE_TYPE in EXECUTOR.
def set_preprocessor(self, message_type, preprocessor, executor): ''' Sets PREPROCESSOR to run on MESSAGE_TYPE in EXECUTOR. PREPROCESSOR: fn(message_content: bytes) -> PreprocessorResult ''' self._preprocessors[message_type] = \ _PreprocessorManager( ...
Do a breadth - first walk of the graph yielding on each node starting at head.
def walk(self, head=None): """Do a breadth-first walk of the graph, yielding on each node, starting at `head`.""" head = head or self._root_node queue = [] queue.insert(0, head) while queue: node = queue.pop() yield node.num, node.previous, node...
Returns the sawtooth configuration directory based on the SAWTOOTH_HOME environment variable ( if set ) or OS defaults.
def _get_config_dir(): """Returns the sawtooth configuration directory based on the SAWTOOTH_HOME environment variable (if set) or OS defaults. """ if 'SAWTOOTH_HOME' in os.environ: return os.path.join(os.environ['SAWTOOTH_HOME'], 'etc') if os.name == 'nt': base_dir = \ ...
Determines the directory path based on configuration.
def _get_dir(toml_config_setting, sawtooth_home_dir, windows_dir, default_dir): """Determines the directory path based on configuration. Arguments: toml_config_setting (str): The name of the config setting related to the directory which will appear in path.toml. sawtooth_home_dir (s...
Get a single Role by name.
def get_role(self, name): """Get a single Role by name. Args: name (str): The name of the Role. Returns: (:obj:`Role`): The Role that matches the name or None. """ address = _create_role_address(name) role_list_bytes = None try: ...
Return all the Roles under the Identity namespace.
def get_roles(self): """Return all the Roles under the Identity namespace. Returns: (list): A list containing all the Roles under the Identity namespace. """ prefix = _IDENTITY_NS + _ROLE_NS rolelist_list = [ _create_from_bytes(d, identit...
Get a single Policy by name.
def get_policy(self, name): """Get a single Policy by name. Args: name (str): The name of the Policy. Returns: (:obj:`Policy`) The Policy that matches the name. """ address = _create_policy_address(name) policy_list_bytes = None try: ...
Returns all the Policies under the Identity namespace.
def get_policies(self): """Returns all the Policies under the Identity namespace. Returns: (list): A list containing all the Policies under the Identity namespace. """ prefix = _IDENTITY_NS + _POLICY_NS policylist_list = [ _create_from_by...
Returns an ordered list of batches to inject at the beginning of the block. Can also return None if no batches should be injected.
def block_start(self, previous_block): """Returns an ordered list of batches to inject at the beginning of the block. Can also return None if no batches should be injected. Args: previous_block (Block): The previous block. Returns: A list of batches to inject. ...
Retrieve the validation rules stored in state and check that the given batches do not violate any of those rules. These rules include:
def enforce_validation_rules(settings_view, expected_signer, batches): """ Retrieve the validation rules stored in state and check that the given batches do not violate any of those rules. These rules include: NofX: Only N of transaction type X may be included in a block. XatY: A transactio...
Only N of transaction type X may be included in a block. The first argument must be interpretable as an integer. The second argument is interpreted as the name of a transaction family. For example the string NofX: 2 intkey means only allow 2 intkey transactions per block.
def _do_nofx(transactions, arguments): """ Only N of transaction type X may be included in a block. The first argument must be interpretable as an integer. The second argument is interpreted as the name of a transaction family. For example, the string "NofX:2,intkey" means only allow 2 intkey transa...
A transaction of type X must be in the block at position Y. The first argument is interpreted as the name of a transaction family. The second argument must be interpretable as an integer and defines the index of the transaction in the block that must be checked. Negative numbers can be used and count backwards from the...
def _do_xaty(transactions, arguments): """ A transaction of type X must be in the block at position Y. The first argument is interpreted as the name of a transaction family. The second argument must be interpretable as an integer and defines the index of the transaction in the block that must be che...
A transaction must be signed by the same key as the block. This rule takes a list of transaction indices in the block and enforces the rule on each. This rule is useful in combination with the other rules to ensure a client is not submitting transactions that should only be injected by the winning validator.
def _do_local(transactions, expected_signer, arguments): """ A transaction must be signed by the same key as the block. This rule takes a list of transaction indices in the block and enforces the rule on each. This rule is useful in combination with the other rules to ensure a client is not submitti...
Returns a ValidatorConfig created by loading a TOML file from the filesystem.
def load_toml_validator_config(filename): """Returns a ValidatorConfig created by loading a TOML file from the filesystem. """ if not os.path.exists(filename): LOGGER.info( "Skipping validator config loading from non-existent config file:" " %s", filename) return ...
Given a list of ValidatorConfig objects merges them into a single ValidatorConfig giving priority in the order of the configs ( first has highest priority ).
def merge_validator_config(configs): """ Given a list of ValidatorConfig objects, merges them into a single ValidatorConfig, giving priority in the order of the configs (first has highest priority). """ bind_network = None bind_component = None bind_consensus = None endpoint = None ...
Loads a private key from the key directory based on a validator s identity.
def load_identity_signer(key_dir, key_name): """Loads a private key from the key directory, based on a validator's identity. Args: key_dir (str): The path to the key directory. key_name (str): The name of the key to load. Returns: Signer: the cryptographic signer for the key ...
Adds argument parser for the status command
def add_status_parser(subparsers, parent_parser): """Adds argument parser for the status command Args: subparsers: Add parsers to this subparser object parent_parser: The parent argparse.ArgumentParser object """ parser = subparsers.add_parser( 'status', help...
Get the next available processor of a particular type and increment its occupancy counter.
def get_next_of_type(self, processor_type): """Get the next available processor of a particular type and increment its occupancy counter. Args: processor_type (ProcessorType): The processor type associated with a zmq identity. Returns: (Processor...
Removes all of the Processors for a particular transaction processor zeromq identity.
def remove(self, processor_identity): """Removes all of the Processors for a particular transaction processor zeromq identity. Args: processor_identity (str): The zeromq identity of the transaction processor. """ with self._condition: proc...
Waits for a particular processor type to register or until is_cancelled is True. is_cancelled cannot be part of this class since we aren t cancelling all waiting for a processor_type but just this particular wait.
def wait_for_registration(self, processor_type): """Waits for a particular processor type to register or until is_cancelled is True. is_cancelled cannot be part of this class since we aren't cancelling all waiting for a processor_type, but just this particular wait. Args: ...
Waits for a particular processor type to have the capacity to handle additional transactions or until is_cancelled is True.
def wait_for_vacancy(self, processor_type): """Waits for a particular processor type to have the capacity to handle additional transactions or until is_cancelled is True. Args: processor_type (ProcessorType): The family, and version of the transaction processor. ...
Get the setting stored at the given key.
def _get_setting(self, key, default_value=None, value_type=str): """Get the setting stored at the given key. Args: key (str): the setting key default_value (str, optional): The default value, if none is found. Defaults to None. value_type (function, o...
Get the setting stored at the given key and split it to a list.
def get_setting_list(self, key, default_value=None, delimiter=',', value_type=str): """Get the setting stored at the given key and split it to a list. Args: key (str): the setting key ...
Computes the radix address for the given setting key.
def setting_address(key): """Computes the radix address for the given setting key. Keys are broken into four parts, based on the dots in the string. For example, the key `a.b.c` address is computed based on `a`, `b`, `c` and the empty string. A longer key, for example `a.b.c.d.e`, is st...
Accepts a binary encoded BatchList and submits it to the validator.
async def submit_batches(self, request): """Accepts a binary encoded BatchList and submits it to the validator. Request: body: octet-stream BatchList of one or more Batches Response: status: - 202: Batches submitted and pending link: /batches...
Fetches the committed status of batches by either a POST or GET.
async def list_statuses(self, request): """Fetches the committed status of batches by either a POST or GET. Request: body: A JSON array of one or more id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wait: Reques...
Fetches list of data entries optionally filtered by address prefix.
async def list_state(self, request): """Fetches list of data entries, optionally filtered by address prefix. Request: query: - head: The id of the block to use as the head of the chain - address: Return entries whose addresses begin with this ...
Fetches data from a specific address in the validator s state tree.
async def fetch_state(self, request): """Fetches data from a specific address in the validator's state tree. Request: query: - head: The id of the block to use as the head of the chain - address: The 70 character address of the data to be fetched Res...
Fetches list of blocks from validator optionally filtered by id.
async def list_blocks(self, request): """Fetches list of blocks from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of block ids to include in results Respo...
Fetches a specific block from the validator specified by id. Request: path: - block_id: The 128 - character id of the block to be fetched
async def fetch_block(self, request): """Fetches a specific block from the validator, specified by id. Request: path: - block_id: The 128-character id of the block to be fetched Response: data: A JSON object with the data from the fully expanded Block ...
Fetches list of batches from validator optionally filtered by id.
async def list_batches(self, request): """Fetches list of batches from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of batch ids to include in results Res...
Fetches a specific batch from the validator specified by id.
async def fetch_batch(self, request): """Fetches a specific batch from the validator, specified by id. Request: path: - batch_id: The 128-character id of the batch to be fetched Response: data: A JSON object with the data from the fully expanded Batch ...
Fetches list of txns from validator optionally filtered by id.
async def list_transactions(self, request): """Fetches list of txns from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of txn ids to include in results Res...
Fetches a specific transaction from the validator specified by id.
async def fetch_transaction(self, request): """Fetches a specific transaction from the validator, specified by id. Request: path: - transaction_id: The 128-character id of the txn to be fetched Response: data: A JSON object with the data from the expande...
Fetches the receipts for transaction by either a POST or GET.
async def list_receipts(self, request): """Fetches the receipts for transaction by either a POST or GET. Request: body: A JSON array of one or more transaction id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wai...
Fetches the peers from the validator. Request:
async def fetch_peers(self, request): """Fetches the peers from the validator. Request: Response: data: JSON array of peer endpoints link: The link to this exact query """ response = await self._query_validator( Message.CLIENT_PEERS_GET_REQUE...
Fetches information pertaining to the valiator s status.
async def fetch_status(self, request): '''Fetches information pertaining to the valiator's status.''' response = await self._query_validator( Message.CLIENT_STATUS_GET_REQUEST, client_status_pb2.ClientStatusGetResponse, client_status_pb2.ClientStatusGetRequest()) ...
Sends a request to the validator and parses the response.
async def _query_validator(self, request_type, response_proto, payload, error_traps=None): """Sends a request to the validator and parses the response. """ LOGGER.debug( 'Sending %s request to validator', self._get_type_name(request_type)) ...