_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q22500 | _check_gle_response | train | def _check_gle_response(result):
"""Return getlasterror response as a dict, or raise OperationFailure."""
# Did getlasterror itself fail?
_check_command_response(result)
if result.get("wtimeout", False):
# MongoDB versions before 1.8.0 return the error message in an "errmsg"
# field. If... | python | {
"resource": ""
} |
q22501 | _raise_last_error | train | def _raise_last_error(bulk_write_result):
"""Backward compatibility helper for insert error handling.
"""
# Prefer write errors over write concern errors
write_errors = bulk_write_result.get("writeErrors")
if write_errors:
_raise_last_write_error(write_errors)
_raise_write_concern_error... | python | {
"resource": ""
} |
q22502 | Topology.open | train | def open(self):
"""Start monitoring, or restart after a fork.
No effect if called multiple times.
.. warning:: Topology is shared among multiple threads and is protected
by mutual exclusion. Using Topology from a process other than the one
that initialized it will emit a wa... | python | {
"resource": ""
} |
q22503 | Topology._process_change | train | def _process_change(self, server_description):
"""Process a new ServerDescription on an opened topology.
Hold the lock when calling this.
"""
td_old = self._description
if self._publish_server:
old_server_description = td_old._server_descriptions[
ser... | python | {
"resource": ""
} |
q22504 | Topology.get_server_session | train | def get_server_session(self):
"""Start or resume a server session, or raise ConfigurationError."""
with self._lock:
session_timeout = self._description.logical_session_timeout_minutes
if session_timeout is None:
# Maybe we need an initial scan? Can raise ServerSel... | python | {
"resource": ""
} |
q22505 | Topology._ensure_opened | train | def _ensure_opened(self):
"""Start monitors, or restart after a fork.
Hold the lock when calling this.
"""
if not self._opened:
self._opened = True
self._update_servers()
# Start or restart the events publishing thread.
if self._publish_t... | python | {
"resource": ""
} |
q22506 | Monitor._check_with_retry | train | def _check_with_retry(self):
"""Call ismaster once or twice. Reset server's pool on error.
Returns a ServerDescription.
"""
# According to the spec, if an ismaster call fails we reset the
# server's pool. If a server was once connected, change its type
# to Unknown only ... | python | {
"resource": ""
} |
q22507 | Monitor._check_once | train | def _check_once(self):
"""A single attempt to call ismaster.
Returns a ServerDescription, or raises an exception.
"""
address = self._server_description.address
if self._publish:
self._listeners.publish_server_heartbeat_started(address)
with self._pool.get_so... | python | {
"resource": ""
} |
q22508 | GridOut.readline | train | def readline(self, size=-1):
"""Read one line or up to `size` bytes from the file.
:Parameters:
- `size` (optional): the maximum number of bytes to read
"""
remainder = int(self.length) - self.__position
if size < 0 or size > remainder:
size = remainder
... | python | {
"resource": ""
} |
q22509 | _GridOutChunkIterator._next_with_retry | train | def _next_with_retry(self):
"""Return the next chunk and retry once on CursorNotFound.
We retry on CursorNotFound to maintain backwards compatibility in
cases where two calls to read occur more than 10 minutes apart (the
server's default cursor timeout).
"""
if self._cur... | python | {
"resource": ""
} |
q22510 | Collection.__create | train | def __create(self, options, collation, session):
"""Sends a create command with the given options.
"""
cmd = SON([("create", self.__name)])
if options:
if "size" in options:
options["size"] = float(options["size"])
cmd.update(options)
with ... | python | {
"resource": ""
} |
q22511 | Collection._legacy_write | train | def _legacy_write(self, sock_info, name, cmd, op_id,
bypass_doc_val, func, *args):
"""Internal legacy unacknowledged write helper."""
# Cannot have both unacknowledged write and bypass document validation.
if bypass_doc_val and sock_info.max_wire_version >= 4:
r... | python | {
"resource": ""
} |
q22512 | Collection._insert_one | train | def _insert_one(
self, doc, ordered,
check_keys, manipulate, write_concern, op_id, bypass_doc_val,
session):
"""Internal helper for inserting a single document."""
if manipulate:
doc = self.__database._apply_incoming_manipulators(doc, self)
if ... | python | {
"resource": ""
} |
q22513 | Collection._aggregate_one_result | train | def _aggregate_one_result(
self, sock_info, slave_ok, cmd, collation=None, session=None):
"""Internal helper to run an aggregate that returns a single result."""
result = self._command(
sock_info,
cmd,
slave_ok,
codec_options=self.__write_respo... | python | {
"resource": ""
} |
q22514 | Collection.estimated_document_count | train | def estimated_document_count(self, **kwargs):
"""Get an estimate of the number of documents in this collection using
collection metadata.
The :meth:`estimated_document_count` method is **not** supported in a
transaction.
All optional parameters should be passed as keyword argum... | python | {
"resource": ""
} |
q22515 | Collection.count_documents | train | def count_documents(self, filter, session=None, **kwargs):
"""Count the number of documents in this collection.
The :meth:`count_documents` method is supported in a transaction.
All optional parameters should be passed as keyword arguments
to this method. Valid options include:
... | python | {
"resource": ""
} |
q22516 | Collection.index_information | train | def index_information(self, session=None):
"""Get information on this collection's indexes.
Returns a dictionary where the keys are index names (as
returned by create_index()) and the values are dictionaries
containing information about each index. The dictionary is
guaranteed t... | python | {
"resource": ""
} |
q22517 | Collection._map_reduce | train | def _map_reduce(self, map, reduce, out, session, read_pref, **kwargs):
"""Internal mapReduce helper."""
cmd = SON([("mapReduce", self.__name),
("map", map),
("reduce", reduce),
("out", out)])
collation = validate_collation_or_none(kwargs.p... | python | {
"resource": ""
} |
q22518 | Collection.find_one_and_delete | train | def find_one_and_delete(self, filter,
projection=None, sort=None, session=None, **kwargs):
"""Finds a single document and deletes it, returning the document.
>>> db.test.count_documents({'x': 1})
2
>>> db.test.find_one_and_delete({'x': 1})
{u'... | python | {
"resource": ""
} |
q22519 | ChangeStream._full_pipeline | train | def _full_pipeline(self):
"""Return the full aggregation pipeline for this ChangeStream."""
options = self._pipeline_options()
full_pipeline = [{'$changeStream': options}]
full_pipeline.extend(self._pipeline)
return full_pipeline | python | {
"resource": ""
} |
q22520 | ChangeStream._run_aggregation_cmd | train | def _run_aggregation_cmd(self, session, explicit_session):
"""Run the full aggregation pipeline for this ChangeStream and return
the corresponding CommandCursor.
"""
read_preference = self._target._read_preference_for(session)
client = self._database.client
def _cmd(sess... | python | {
"resource": ""
} |
q22521 | ChangeStream._resume | train | def _resume(self):
"""Reestablish this change stream after a resumable error."""
try:
self._cursor.close()
except PyMongoError:
pass
self._cursor = self._create_cursor() | python | {
"resource": ""
} |
q22522 | ChangeStream.try_next | train | def try_next(self):
"""Advance the cursor without blocking indefinitely.
This method returns the next change document without waiting
indefinitely for the next change. For example::
with db.collection.watch() as stream:
while stream.alive:
change... | python | {
"resource": ""
} |
q22523 | validate_non_negative_int_or_basestring | train | def validate_non_negative_int_or_basestring(option, value):
"""Validates that 'value' is an integer or string.
"""
if isinstance(value, integer_types):
return value
elif isinstance(value, string_type):
try:
val = int(value)
except ValueError:
return value
... | python | {
"resource": ""
} |
q22524 | validate_type_registry | train | def validate_type_registry(option, value):
"""Validate the type_registry option."""
if value is not None and not isinstance(value, TypeRegistry):
raise TypeError("%s must be an instance of %s" % (
option, TypeRegistry))
return value | python | {
"resource": ""
} |
q22525 | validate_driver_or_none | train | def validate_driver_or_none(option, value):
"""Validate the driver keyword arg."""
if value is None:
return value
if not isinstance(value, DriverInfo):
raise TypeError("%s must be an instance of DriverInfo" % (option,))
return value | python | {
"resource": ""
} |
q22526 | validate_is_callable_or_none | train | def validate_is_callable_or_none(option, value):
"""Validates that 'value' is a callable."""
if value is None:
return value
if not callable(value):
raise ValueError("%s must be a callable" % (option,))
return value | python | {
"resource": ""
} |
q22527 | BaseObject._read_preference_for | train | def _read_preference_for(self, session):
"""Read only access to the read preference of this instance or session.
"""
# Override this operation's read preference with the transaction's.
if session:
return session._txn_read_preference() or self.__read_preference
return ... | python | {
"resource": ""
} |
q22528 | get_data_files | train | def get_data_files(top):
"""Get data files"""
data_files = []
ntrim = len(here + os.path.sep)
for (d, _, filenames) in os.walk(top):
data_files.append((
d[ntrim:],
[os.path.join(d, f) for f in filenames]
))
return data_files | python | {
"resource": ""
} |
q22529 | run | train | def run(cmd, *args, **kwargs):
"""Echo a command before running it. Defaults to repo as cwd"""
log.info('> ' + list2cmdline(cmd))
kwargs.setdefault('cwd', here)
kwargs.setdefault('shell', sys.platform == 'win32')
if not isinstance(cmd, list):
cmd = cmd.split()
return check_call(cmd, *ar... | python | {
"resource": ""
} |
q22530 | combine_commands | train | def combine_commands(*commands):
"""Return a Command that combines several commands."""
class CombinedCommand(Command):
def initialize_options(self):
self.commands = []
for C in commands:
self.commands.append(C(self.distribution))
for c in self.comma... | python | {
"resource": ""
} |
q22531 | run_gradle | train | def run_gradle(path=kernel_path, cmd='build', skip_tests=False):
"""Return a Command for running gradle scripts.
Parameters
----------
path: str, optional
The base path of the node package. Defaults to the repo root.
cmd: str, optional
The command to run with gradlew.
"""
... | python | {
"resource": ""
} |
q22532 | Init.read_init_status | train | def read_init_status(self):
"""Read the initialization status of Vault.
Supported methods:
GET: /sys/init. Produces: 200 application/json
:return: The JSON response of the request.
:rtype: dict
"""
api_path = '/v1/sys/init'
response = self._adapter.g... | python | {
"resource": ""
} |
q22533 | Init.initialize | train | def initialize(self, secret_shares=5, secret_threshold=3, pgp_keys=None, root_token_pgp_key=None,
stored_shares=None, recovery_shares=None, recovery_threshold=None, recovery_pgp_keys=None):
"""Initialize a new Vault.
The Vault must not have been previously initialized. The recovery o... | python | {
"resource": ""
} |
q22534 | KvV1.list_secrets | train | def list_secrets(self, path, mount_point=DEFAULT_MOUNT_POINT):
"""Return a list of key names at the specified location.
Folders are suffixed with /. The input must be a folder; list on a file will not return a value. Note that no
policy-based filtering is performed on keys; do not encode sensit... | python | {
"resource": ""
} |
q22535 | KvV1.create_or_update_secret | train | def create_or_update_secret(self, path, secret, method=None, mount_point=DEFAULT_MOUNT_POINT):
"""Store a secret at the specified location.
If the value does not yet exist, the calling token must have an ACL policy granting the create capability.
If the value already exists, the calling token m... | python | {
"resource": ""
} |
q22536 | KvV1.delete_secret | train | def delete_secret(self, path, mount_point=DEFAULT_MOUNT_POINT):
"""Delete the secret at the specified location.
Supported methods:
DELETE: /{mount_point}/{path}. Produces: 204 (empty body)
:param path: Specifies the path of the secret to delete.
This is specified as pa... | python | {
"resource": ""
} |
q22537 | Radius.configure | train | def configure(self, host, secret, port=1812, unregistered_user_policies=None, dial_timeout=10, nas_port=10,
mount_point=DEFAULT_MOUNT_POINT):
"""
Configure the RADIUS auth method.
Supported methods:
POST: /auth/{mount_point}/config. Produces: 204 (empty body)
... | python | {
"resource": ""
} |
q22538 | Aws.configure_root_iam_credentials | train | def configure_root_iam_credentials(self, access_key, secret_key, region=None, iam_endpoint=None, sts_endpoint=None,
max_retries=-1, mount_point=DEFAULT_MOUNT_POINT):
"""Configure the root IAM credentials to communicate with AWS.
There are multiple ways to pass roo... | python | {
"resource": ""
} |
q22539 | Aws.rotate_root_iam_credentials | train | def rotate_root_iam_credentials(self, mount_point=DEFAULT_MOUNT_POINT):
"""Rotate static root IAM credentials.
When you have configured Vault with static credentials, you can use this endpoint to have Vault rotate the
access key it used. Note that, due to AWS eventual consistency, after calling... | python | {
"resource": ""
} |
q22540 | Aws.configure_lease | train | def configure_lease(self, lease, lease_max, mount_point=DEFAULT_MOUNT_POINT):
"""Configure lease settings for the AWS secrets engine.
It is optional, as there are default values for lease and lease_max.
Supported methods:
POST: /{mount_point}/config/lease. Produces: 204 (empty body... | python | {
"resource": ""
} |
q22541 | Aws.read_lease_config | train | def read_lease_config(self, mount_point=DEFAULT_MOUNT_POINT):
"""Read the current lease settings for the AWS secrets engine.
Supported methods:
GET: /{mount_point}/config/lease. Produces: 200 application/json
:param mount_point: The "path" the method/backend was mounted on.
... | python | {
"resource": ""
} |
q22542 | Aws.create_or_update_role | train | def create_or_update_role(self, name, credential_type, policy_document=None, default_sts_ttl=None, max_sts_ttl=None,
role_arns=None, policy_arns=None, legacy_params=False, mount_point=DEFAULT_MOUNT_POINT):
"""Create or update the role with the given name.
If a role with th... | python | {
"resource": ""
} |
q22543 | Aws.delete_role | train | def delete_role(self, name, mount_point=DEFAULT_MOUNT_POINT):
"""Delete an existing role by the given name.
If the role does not exist, a 404 is returned.
Supported methods:
DELETE: /{mount_point}/roles/{name}. Produces: 204 (empty body)
:param name: the name of the role t... | python | {
"resource": ""
} |
q22544 | Aws.generate_credentials | train | def generate_credentials(self, name, role_arn=None, ttl="3600s", endpoint='creds', mount_point=DEFAULT_MOUNT_POINT):
"""Generates credential based on the named role.
This role must be created before queried.
The /aws/creds and /aws/sts endpoints are almost identical. The exception is when retr... | python | {
"resource": ""
} |
q22545 | Azure.configure | train | def configure(self, subscription_id, tenant_id, client_id="", client_secret="", environment='AzurePublicCloud',
mount_point=DEFAULT_MOUNT_POINT):
"""Configure the credentials required for the plugin to perform API calls to Azure.
These credentials will be used to query roles and creat... | python | {
"resource": ""
} |
q22546 | Azure.delete_config | train | def delete_config(self, mount_point=DEFAULT_MOUNT_POINT):
"""Delete the stored Azure configuration and credentials.
Supported methods:
DELETE: /auth/{mount_point}/config. Produces: 204 (empty body)
:param mount_point: The "path" the method/backend was mounted on.
:type mou... | python | {
"resource": ""
} |
q22547 | Azure.create_or_update_role | train | def create_or_update_role(self, name, azure_roles, ttl="", max_ttl="", mount_point=DEFAULT_MOUNT_POINT):
"""Create or update a Vault role.
The provided Azure roles must exist for this call to succeed. See the Azure secrets roles docs for more
information about roles.
Supported methods:... | python | {
"resource": ""
} |
q22548 | Ldap.configure | train | def configure(self, user_dn, group_dn, url='ldap://127.0.0.1', case_sensitive_names=False, starttls=False,
tls_min_version='tls12', tls_max_version='tls12', insecure_tls=False, certificate=None, bind_dn=None,
bind_pass=None, user_attr='cn', discover_dn=False, deny_null_bind=True, upn... | python | {
"resource": ""
} |
q22549 | Ldap.create_or_update_group | train | def create_or_update_group(self, name, policies=None, mount_point=DEFAULT_MOUNT_POINT):
"""
Create or update LDAP group policies.
Supported methods:
POST: /auth/{mount_point}/groups/{name}. Produces: 204 (empty body)
:param name: The name of the LDAP group
:type na... | python | {
"resource": ""
} |
q22550 | Ldap.create_or_update_user | train | def create_or_update_user(self, username, policies=None, groups=None, mount_point=DEFAULT_MOUNT_POINT):
"""
Create or update LDAP users policies and group associations.
Supported methods:
POST: /auth/{mount_point}/users/{username}. Produces: 204 (empty body)
:param usernam... | python | {
"resource": ""
} |
q22551 | Wrapping.unwrap | train | def unwrap(self, token=None):
"""Return the original response inside the given wrapping token.
Unlike simply reading cubbyhole/response (which is deprecated), this endpoint provides additional validation
checks on the token, returns the original value on the wire rather than a JSON string repre... | python | {
"resource": ""
} |
q22552 | KvV2.configure | train | def configure(self, max_versions=10, cas_required=None, mount_point=DEFAULT_MOUNT_POINT):
"""Configure backend level settings that are applied to every key in the key-value store.
Supported methods:
POST: /{mount_point}/config. Produces: 204 (empty body)
:param max_versions: The n... | python | {
"resource": ""
} |
q22553 | KvV2.read_secret_version | train | def read_secret_version(self, path, version=None, mount_point=DEFAULT_MOUNT_POINT):
"""Retrieve the secret at the specified location.
Supported methods:
GET: /{mount_point}/data/{path}. Produces: 200 application/json
:param path: Specifies the path of the secret to read. This is s... | python | {
"resource": ""
} |
q22554 | KvV2.create_or_update_secret | train | def create_or_update_secret(self, path, secret, cas=None, mount_point=DEFAULT_MOUNT_POINT):
"""Create a new version of a secret at the specified location.
If the value does not yet exist, the calling token must have an ACL policy granting the create capability. If
the value already exists, the ... | python | {
"resource": ""
} |
q22555 | KvV2.patch | train | def patch(self, path, secret, mount_point=DEFAULT_MOUNT_POINT):
"""Set or update data in the KV store without overwriting.
:param path: Path
:type path: str | unicode
:param secret: The contents of the "secret" dict will be stored and returned on read.
:type secret: dict
... | python | {
"resource": ""
} |
q22556 | KvV2.delete_secret_versions | train | def delete_secret_versions(self, path, versions, mount_point=DEFAULT_MOUNT_POINT):
"""Issue a soft delete of the specified versions of the secret.
This marks the versions as deleted and will stop them from being returned from reads,
but the underlying data will not be removed. A delete can be u... | python | {
"resource": ""
} |
q22557 | KvV2.read_secret_metadata | train | def read_secret_metadata(self, path, mount_point=DEFAULT_MOUNT_POINT):
"""Retrieve the metadata and versions for the secret at the specified path.
Supported methods:
GET: /{mount_point}/metadata/{path}. Produces: 200 application/json
:param path: Specifies the path of the secret t... | python | {
"resource": ""
} |
q22558 | KvV2.update_metadata | train | def update_metadata(self, path, max_versions=None, cas_required=None, mount_point=DEFAULT_MOUNT_POINT):
"""Updates the max_versions of cas_required setting on an existing path.
Supported methods:
POST: /{mount_point}/metadata/{path}. Produces: 204 (empty body)
:param path: Path
... | python | {
"resource": ""
} |
q22559 | Gcp.configure | train | def configure(self, credentials="", google_certs_endpoint=GCP_CERTS_ENDPOINT, mount_point=DEFAULT_MOUNT_POINT):
"""Configure the credentials required for the GCP auth method to perform API calls to Google Cloud.
These credentials will be used to query the status of IAM entities and get service account ... | python | {
"resource": ""
} |
q22560 | Gcp.create_role | train | def create_role(self, name, role_type, project_id, ttl="", max_ttl="", period="", policies=None,
bound_service_accounts=None, max_jwt_exp='15m', allow_gce_inference=True, bound_zones=None,
bound_regions=None, bound_instance_groups=None, bound_labels=None, mount_point=DEFAULT_MOUN... | python | {
"resource": ""
} |
q22561 | Gcp.edit_labels_on_gce_role | train | def edit_labels_on_gce_role(self, name, add=None, remove=None, mount_point=DEFAULT_MOUNT_POINT):
"""Edit labels for an existing GCE role in the backend.
This allows you to add or remove labels (keys, values, or both) from the list of keys on the role.
Supported methods:
POST: /auth... | python | {
"resource": ""
} |
q22562 | Gcp.delete_role | train | def delete_role(self, role, mount_point=DEFAULT_MOUNT_POINT):
"""Delete the previously registered role.
Supported methods:
DELETE: /auth/{mount_point}/role/{role}. Produces: 204 (empty body)
:param role: The name of the role to delete.
:type role: str | unicode
:pa... | python | {
"resource": ""
} |
q22563 | Gcp.login | train | def login(self, role, jwt, use_token=True, mount_point=DEFAULT_MOUNT_POINT):
"""Login to retrieve a Vault token via the GCP auth method.
This endpoint takes a signed JSON Web Token (JWT) and a role name for some entity. It verifies the JWT
signature with Google Cloud to authenticate that en... | python | {
"resource": ""
} |
q22564 | Okta.configure | train | def configure(self, org_name, api_token=None, base_url='okta.com', ttl=None, max_ttl=None, bypass_okta_mfa=False,
mount_point=DEFAULT_MOUNT_POINT):
"""Configure the connection parameters for Okta.
This path honors the distinction between the create and update capabilities inside ACL p... | python | {
"resource": ""
} |
q22565 | Okta.register_user | train | def register_user(self, username, groups=None, policies=None, mount_point=DEFAULT_MOUNT_POINT):
"""Register a new user and maps a set of policies to it.
Supported methods:
POST: /auth/{mount_point}/users/{username}. Produces: 204 (empty body)
:param username: Name of the user.
... | python | {
"resource": ""
} |
q22566 | Okta.read_user | train | def read_user(self, username, mount_point=DEFAULT_MOUNT_POINT):
"""Read the properties of an existing username.
Supported methods:
GET: /auth/{mount_point}/users/{username}. Produces: 200 application/json
:param username: Username for this user.
:type username: str | unicod... | python | {
"resource": ""
} |
q22567 | Okta.delete_user | train | def delete_user(self, username, mount_point=DEFAULT_MOUNT_POINT):
"""Delete an existing username from the method.
Supported methods:
DELETE: /auth/{mount_point}/users/{username}. Produces: 204 (empty body)
:param username: Username for this user.
:type username: str | unico... | python | {
"resource": ""
} |
q22568 | Okta.register_group | train | def register_group(self, name, policies=None, mount_point=DEFAULT_MOUNT_POINT):
"""Register a new group and maps a set of policies to it.
Supported methods:
POST: /auth/{mount_point}/groups/{name}. Produces: 204 (empty body)
:param name: The name of the group.
:type name: s... | python | {
"resource": ""
} |
q22569 | VaultApiCategory.adapter | train | def adapter(self, adapter):
"""Sets the adapter instance under the "_adapter" property in use by this class.
Also sets the adapter property for all implemented classes under this category.
:param adapter: New adapter instance to set for this class and all implemented classes under this categor... | python | {
"resource": ""
} |
q22570 | Github.configure | train | def configure(self, organization, base_url='', ttl='', max_ttl='', mount_point=DEFAULT_MOUNT_POINT):
"""Configure the connection parameters for GitHub.
This path honors the distinction between the create and update capabilities inside ACL policies.
Supported methods:
POST: /auth/{m... | python | {
"resource": ""
} |
q22571 | Github.map_team | train | def map_team(self, team_name, policies=None, mount_point=DEFAULT_MOUNT_POINT):
"""Map a list of policies to a team that exists in the configured GitHub organization.
Supported methods:
POST: /auth/{mount_point}/map/teams/{team_name}. Produces: 204 (empty body)
:param team_name: Gi... | python | {
"resource": ""
} |
q22572 | Github.read_team_mapping | train | def read_team_mapping(self, team_name, mount_point=DEFAULT_MOUNT_POINT):
"""Read the GitHub team policy mapping.
Supported methods:
GET: /auth/{mount_point}/map/teams/{team_name}. Produces: 200 application/json
:param team_name: GitHub team name
:type team_name: str | unic... | python | {
"resource": ""
} |
q22573 | Github.read_user_mapping | train | def read_user_mapping(self, user_name, mount_point=DEFAULT_MOUNT_POINT):
"""Read the GitHub user policy mapping.
Supported methods:
GET: /auth/{mount_point}/map/users/{user_name}. Produces: 200 application/json
:param user_name: GitHub user name
:type user_name: str | unic... | python | {
"resource": ""
} |
q22574 | Github.login | train | def login(self, token, use_token=True, mount_point=DEFAULT_MOUNT_POINT):
"""Login using GitHub access token.
Supported methods:
POST: /auth/{mount_point}/login. Produces: 200 application/json
:param token: GitHub personal API token.
:type token: str | unicode
:para... | python | {
"resource": ""
} |
q22575 | generate_sigv4_auth_request | train | def generate_sigv4_auth_request(header_value=None):
"""Helper function to prepare a AWS API request to subsequently generate a "AWS Signature Version 4" header.
:param header_value: Vault allows you to require an additional header, X-Vault-AWS-IAM-Server-ID, to be present
to mitigate against different ... | python | {
"resource": ""
} |
q22576 | Lease.read_lease | train | def read_lease(self, lease_id):
"""Retrieve lease metadata.
Supported methods:
PUT: /sys/leases/lookup. Produces: 200 application/json
:param lease_id: the ID of the lease to lookup.
:type lease_id: str | unicode
:return: Parsed JSON response from the leases PUT req... | python | {
"resource": ""
} |
q22577 | Lease.list_leases | train | def list_leases(self, prefix):
"""Retrieve a list of lease ids.
Supported methods:
LIST: /sys/leases/lookup/{prefix}. Produces: 200 application/json
:param prefix: Lease prefix to filter list by.
:type prefix: str | unicode
:return: The JSON response of the request.... | python | {
"resource": ""
} |
q22578 | Lease.renew_lease | train | def renew_lease(self, lease_id, increment=None):
"""Renew a lease, requesting to extend the lease.
Supported methods:
PUT: /sys/leases/renew. Produces: 200 application/json
:param lease_id: The ID of the lease to extend.
:type lease_id: str | unicode
:param incremen... | python | {
"resource": ""
} |
q22579 | Lease.revoke_lease | train | def revoke_lease(self, lease_id):
"""Revoke a lease immediately.
Supported methods:
PUT: /sys/leases/revoke. Produces: 204 (empty body)
:param lease_id: Specifies the ID of the lease to revoke.
:type lease_id: str | unicode
:return: The response of the request.
... | python | {
"resource": ""
} |
q22580 | Identity.create_or_update_entity | train | def create_or_update_entity(self, name, entity_id=None, metadata=None, policies=None, disabled=False,
mount_point=DEFAULT_MOUNT_POINT):
"""Create or update an Entity.
Supported methods:
POST: /{mount_point}/entity. Produces: 200 application/json
:par... | python | {
"resource": ""
} |
q22581 | Identity.read_entity | train | def read_entity(self, entity_id, mount_point=DEFAULT_MOUNT_POINT):
"""Query an entity by its identifier.
Supported methods:
GET: /auth/{mount_point}/entity/id/{id}. Produces: 200 application/json
:param entity_id: Identifier of the entity.
:type entity_id: str
:para... | python | {
"resource": ""
} |
q22582 | Identity.delete_entity | train | def delete_entity(self, entity_id, mount_point=DEFAULT_MOUNT_POINT):
"""Delete an entity and all its associated aliases.
Supported methods:
DELETE: /{mount_point}/entity/id/:id. Produces: 204 (empty body)
:param entity_id: Identifier of the entity.
:type entity_id: str
... | python | {
"resource": ""
} |
q22583 | Identity.merge_entities | train | def merge_entities(self, from_entity_ids, to_entity_id, force=False, mount_point=DEFAULT_MOUNT_POINT):
"""Merge many entities into one entity.
Supported methods:
POST: /{mount_point}/entity/merge. Produces: 204 (empty body)
:param from_entity_ids: Entity IDs which needs to get merg... | python | {
"resource": ""
} |
q22584 | Identity.read_entity_alias | train | def read_entity_alias(self, alias_id, mount_point=DEFAULT_MOUNT_POINT):
"""Query the entity alias by its identifier.
Supported methods:
GET: /{mount_point}/entity-alias/id/{id}. Produces: 200 application/json
:param alias_id: Identifier of entity alias.
:type alias_id: str ... | python | {
"resource": ""
} |
q22585 | Identity.update_entity_alias | train | def update_entity_alias(self, alias_id, name, canonical_id, mount_accessor, mount_point=DEFAULT_MOUNT_POINT):
"""Update an existing entity alias.
Supported methods:
POST: /{mount_point}/entity-alias/id/{id}. Produces: 200 application/json
:param alias_id: Identifier of the entity a... | python | {
"resource": ""
} |
q22586 | Identity.list_entity_aliases | train | def list_entity_aliases(self, method='LIST', mount_point=DEFAULT_MOUNT_POINT):
"""List available entity aliases by their identifiers.
:param method: Supported methods:
LIST: /{mount_point}/entity-alias/id. Produces: 200 application/json
GET: /{mount_point}/entity-alias/id?list=t... | python | {
"resource": ""
} |
q22587 | Identity.delete_entity_alias | train | def delete_entity_alias(self, alias_id, mount_point=DEFAULT_MOUNT_POINT):
"""Delete a entity alias.
Supported methods:
DELETE: /{mount_point}/entity-alias/id/{alias_id}. Produces: 204 (empty body)
:param alias_id: Identifier of the entity.
:type alias_id: str | unicode
... | python | {
"resource": ""
} |
q22588 | Identity.read_group | train | def read_group(self, group_id, mount_point=DEFAULT_MOUNT_POINT):
"""Query the group by its identifier.
Supported methods:
GET: /{mount_point}/group/id/{id}. Produces: 200 application/json
:param group_id: Identifier of the group.
:type group_id: str | unicode
:param... | python | {
"resource": ""
} |
q22589 | Identity.create_or_update_group_by_name | train | def create_or_update_group_by_name(self, name, group_type="internal", metadata=None, policies=None, member_group_ids=None,
member_entity_ids=None, mount_point=DEFAULT_MOUNT_POINT):
"""Create or update a group by its name.
Supported methods:
POST: /{mou... | python | {
"resource": ""
} |
q22590 | Identity.create_or_update_group_alias | train | def create_or_update_group_alias(self, name, alias_id=None, mount_accessor=None, canonical_id=None, mount_point=DEFAULT_MOUNT_POINT):
"""Creates or update a group alias.
Supported methods:
POST: /{mount_point}/group-alias. Produces: 200 application/json
:param alias_id: ID of the g... | python | {
"resource": ""
} |
q22591 | Identity.update_group_alias | train | def update_group_alias(self, entity_id, name, mount_accessor="", canonical_id="", mount_point=DEFAULT_MOUNT_POINT):
"""Update an existing group alias.
Supported methods:
POST: /{mount_point}/group-alias/id/{id}. Produces: 200 application/json
:param entity_id: ID of the group alias... | python | {
"resource": ""
} |
q22592 | Identity.lookup_entity | train | def lookup_entity(self, name=None, entity_id=None, alias_id=None, alias_name=None, alias_mount_accessor=None, mount_point=DEFAULT_MOUNT_POINT):
"""Query an entity based on the given criteria.
The criteria can be name, id, alias_id, or a combination of alias_name and alias_mount_accessor.
Suppo... | python | {
"resource": ""
} |
q22593 | Transit.create_key | train | def create_key(self, name, convergent_encryption=False, derived=False, exportable=False, allow_plaintext_backup=False,
key_type="aes256-gcm96", mount_point=DEFAULT_MOUNT_POINT):
"""Create a new named encryption key of the specified type.
The values set here cannot be changed after ke... | python | {
"resource": ""
} |
q22594 | Transit.update_key_configuration | train | def update_key_configuration(self, name, min_decryption_version=0, min_encryption_version=0, deletion_allowed=False,
exportable=False, allow_plaintext_backup=False, mount_point=DEFAULT_MOUNT_POINT):
"""Tune configuration values for a given key.
These values are returned... | python | {
"resource": ""
} |
q22595 | Transit.rotate_key | train | def rotate_key(self, name, mount_point=DEFAULT_MOUNT_POINT):
"""Rotate the version of the named key.
After rotation, new plaintext requests will be encrypted with the new version of the key. To upgrade ciphertext
to be encrypted with the latest version of the key, use the rewrap endpoint. This ... | python | {
"resource": ""
} |
q22596 | Transit.export_key | train | def export_key(self, name, key_type, version=None, mount_point=DEFAULT_MOUNT_POINT):
"""Return the named key.
The keys object shows the value of the key for each version. If version is specified, the specific version will
be returned. If latest is provided as the version, the current key will b... | python | {
"resource": ""
} |
q22597 | Transit.encrypt_data | train | def encrypt_data(self, name, plaintext, context="", key_version=0, nonce=None, batch_input=None, type="aes256-gcm96",
convergent_encryption="", mount_point=DEFAULT_MOUNT_POINT):
"""Encrypt the provided plaintext using the named key.
This path supports the create and update policy c... | python | {
"resource": ""
} |
q22598 | Transit.decrypt_data | train | def decrypt_data(self, name, ciphertext, context="", nonce="", batch_input=None, mount_point=DEFAULT_MOUNT_POINT):
"""Decrypt the provided ciphertext using the named key.
Supported methods:
POST: /{mount_point}/decrypt/{name}. Produces: 200 application/json
:param name: Specifies t... | python | {
"resource": ""
} |
q22599 | Transit.generate_data_key | train | def generate_data_key(self, name, key_type, context="", nonce="", bits=256, mount_point=DEFAULT_MOUNT_POINT):
"""Generates a new high-entropy key and the value encrypted with the named key.
Optionally return the plaintext of the key as well. Whether plaintext is returned depends on the path; as a
... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.