Key-Values

class datarobot.models.key_values.KeyValue(id, created_at, entity_id, entity_type, name, value, numeric_value, boolean_value, value_type, description, creator_id, creator_name, category, artifact_size, original_file_name, is_editable, is_dataset_missing, error_message)

A DataRobot Key-Value.

Added in version v3.4.

Attributes:
id: str

ID of the Key-Value

created_at: str

creation time of the Key-Value

entity_id: str

ID of the related Entity

entity_type: KeyValueEntityType

type of the related Entity

name: str

Key-Value name

value: str

Key-Value value

numeric_value: float

Key-Value numeric value

boolean_value: bool

Key-Value boolean value

value_type: KeyValueType

Key-Value type

description: str

Key-Value description

creator_id: str

ID of the user who created the Key-Value

creator_name: str

ID of the user who created the Key-Value

category: KeyValueCategory

Key-Value category

artifact_size: int

size in bytes of associated image, if applicable

original_file_name: str

name of uploaded original image or dataset file

is_editable: bool

true if a user with permissions can edit or delete

is_dataset_missing: bool

true if 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 Key-Value by id. :rtype: KeyValue

Added in version v3.4.

Parameters:
key_value_id: str

ID of the Key-Value

Returns:
KeyValue

retrieved Key-Value

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 Key-Values. :rtype: List[KeyValue]

Added in version v3.4.

Parameters:
entity_id: str

ID of the related Entity

entity_type: KeyValueEntityType

type of the related Entity

Returns:
List[KeyValue]

a list of Key-Values

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 Key-Value by name. :rtype: Optional[KeyValue]

Added in version v3.4.

Parameters:
entity_id: str

ID of the related Entity

entity_type: KeyValueEntityType

type of the related Entity

name: str

name of the Key-Value

Returns:
List[KeyValue]

a list of Key-Values

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. :rtype: KeyValue

Added in version v3.4.

Parameters:
entity_id: str

ID of the associated resource

entity_type: KeyValueEntityType

type of the associated resource

name: str

name of the Key-Value. Cannot contain: { } ; |

category: KeyValueCategory

category of the Key-Value

value_type: KeyValueType

type of the Key-Value value

value: Optional[Union[str, float, bool]]

value of Key-Value

description: Optional[str]

description of the Key-Value

Returns:
KeyValue

created Key-Value

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 Key-Value. :rtype: None

Added in version v3.4.

Parameters:
entity_id: Optional[str]

ID of the associated resource

entity_type: Optional[KeyValueEntityType]

type of the associated resource

name: Optional[str]

name of the Key-Value. Cannot contain: { } ; |

category: Optional[KeyValueCategory]

category of the Key-Value

value_type: Optional[KeyValueType]

type of the Key-Value value

value: Optional[[Union[str, float, bool]]

value of Key-Value

description: Optional[str]

description of the Key-Value

comment: Optional[str]

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.

refresh()

Update Key-Value with the latest data from server. :rtype: None

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

delete()

Delete Key-Value. :rtype: None

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.

get_value()

Get a value of Key-Value. :rtype: Union[str, float, bool]

Added in version v3.4.

Returns:
Union[str, float, boolean]

value depending on the value type

class datarobot.enums.KeyValueCategory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Key-Value category

class datarobot.enums.KeyValueEntityType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Key-Value entity type

class datarobot.enums.KeyValueType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Key-Value type