Key-Values
- class datarobot.models.key_values.KeyValue
A DataRobot key-value.
Added in version v3.4.
- Variables:
id (
str) – The ID of the key-value.created_at (
str) – The creation time of the key-value.entity_id (
str) – The ID of the related entity.entity_type (
KeyValueEntityType) – The type of the related entity.name (
str) – The key-value name.value (
str) – The key-value value.numeric_value (
float) – The numeric value of the key-value.boolean_value (
bool) – The true/false value of the key-value.value_type (
KeyValueType) – The key-value type.description (
str) – The key-value description.creator_id (
str) – The ID of the user who created the key-value.creator_name (
str) – The name of the user who created the key-value.category (
KeyValueCategory) – The key-value category.artifact_size (
int) – The size in bytes of the associated image, if applicable.original_file_name (
str) – The name of the uploaded original image or dataset file.is_editable (
bool) – Whether a user with permissions can edit or delete the key-value.is_dataset_missing (
bool) – Whether the key-value type is “dataset” and its dataset is not visible to the user.error_message (
str) – Additional information if isDataSetMissing is true; blank if there are no errors.
- classmethod get(key_value_id)
Get the key-value by ID.
Added in version v3.4.
- Parameters:
key_value_id (
str) – The ID of the key-value.- Returns:
The retrieved key-value.
- Return type:
- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- classmethod list(entity_id, entity_type)
List the key-values.
Added in version v3.4.
- Parameters:
entity_id (
str) – The ID of the related entity.entity_type (
KeyValueEntityType) – The type of the related entity.
- Returns:
A list of key-values.
- Return type:
List[KeyValue]- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- classmethod find(entity_id, entity_type, name)
Find a key-value by name.
Added in version v3.4.
- Parameters:
entity_id (
str) – The ID of the related entity.entity_type (
KeyValueEntityType) – The type of the related entity.name (
str) – The name of the key-value.
- Returns:
A list of key-values.
- Return type:
List[KeyValue]- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- classmethod create(entity_id, entity_type, name, category, value_type, value=None, description=None)
Create a Key-Value.
Added in version v3.4.
- Parameters:
entity_id (
str) – The ID of the associated resource.entity_type (
KeyValueEntityType) – The type of the associated resource.name (
str) – The name of the key-value. It cannot contain{ } ; |.category (
KeyValueCategory) – The category of the key-value.value_type (
KeyValueType) – The type of the key-value value.value (
Optional[Union[str,float,bool]]) – The value of the key-value.description (
Optional[str]) – The description of the key-value.
- Returns:
The created key-value.
- Return type:
- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- update(entity_id=None, entity_type=None, name=None, category=None, value_type=None, value=None, description=None, comment=None)
Update the key-value.
Added in version v3.4.
- Parameters:
entity_id (
Optional[str]) – The ID of the associated resource.entity_type (
Optional[KeyValueEntityType]) – The type of the associated resource.name (
Optional[str]) – The name of the key-value. It cannot contain{ } ; |.category (
Optional[KeyValueCategory]) – The category of the key-value.value_type (
Optional[KeyValueType]) – The type of the key-value value.value (
Optional[[Union[str,float,bool]]) – The value of the key-value.description (
Optional[str]) – The description of the key-value.comment (
Optional[str]) – The user comment explaining the change.
- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- Return type:
None
- refresh()
Update the key-value with the latest data from the server.
Added in version v3.4.
- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- Return type:
None
- delete()
Delete the key-value.
Added in version v3.4.
- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- Return type:
None
- get_value()
Get a value of Key-Value.
Added in version v3.4.
- Returns:
value depending on the value type
- Return type:
Union[str,float,boolean]
- class datarobot.enums.KeyValueCategory
Key-Value category
- class datarobot.enums.KeyValueEntityType
Key-Value entity type
- class datarobot.enums.KeyValueType
Key-Value type