Govern#

For usage information and examples, see Govern

class dataikuapi.govern_client.GovernClient(host, api_key=None, internal_ticket=None, extra_headers=None)#

Entry point for the Govern API client

get_blueprint_designer()#

Return a handle to interact with the blueprint designer Note: this call requires an API key with Govern manager rights

Return type:

A GovernAdminBlueprintDesigner

get_roles_permissions_handler()#

Return a handler to manage the roles and permissions of the Govern instance Note: this call requires an API key with Govern manager rights

Return type:

A GovernAdminRolesPermissionsHandler

get_custom_pages_handler()#

Return a handler to manage custom pages Note: this call requires an API key with Govern manager rights

Return type:

A GovernAdminCustomPagesHandler

list_blueprints()#

List all the blueprints

Returns:

a list of blueprints

Return type:

list of GovernBlueprintListItem

get_blueprint(blueprint_id)#

Get a handle to interact with a blueprint. If you want to edit it or one of its versions, use instead: get_blueprint()

Parameters:

blueprint_id (str) – id of the blueprint to retrieve

Returns:

The handle of the blueprint

Return type:

GovernBlueprint

get_artifact(artifact_id)#

Return a handle to interact with an artifact.

Parameters:

artifact_id (str) – id of the artifact to retrieve

Returns:

the corresponding GovernArtifact

create_artifact(artifact)#

Create an artifact

Parameters:

artifact (dict) – the definition of the artifact as a dict

Returns:

the created GovernArtifact

new_artifact_search_request(artifact_search_query)#

Create a new artifact search request and return the object that will be used to launch the requests.

Parameters:

artifact_search_query (GovernArtifactSearchQuery) – The query that will be addressed during the search.

Returns:

The created artifact search request object

Return type:

GovernArtifactSearchRequest

get_custom_page(custom_page_id)#

Retrieve a custom page. To edit a custom page use instead the custom page editor get_custom_page()

Parameters:

custom_page_id (str) – id of the custom page to retrieve

Returns:

the corresponding custom page object

Return type:

a GovernCustomPage

list_custom_pages()#

List custom pages.

Returns:

a list of custom pages

Return type:

list of GovernCustomPageListItem

create_time_series(datapoints=None)#

Create a new time series and push a list of values inside it.

Parameters:

datapoints (list) – (Optional) a list of Python dict - The list of datapoints as Python dict containing the following keys “timeSeriesId”, “timestamp” (an epoch in milliseconds), and “value” (an object)

Returns:

the created time-series object

Return type:

a GovernTimeSeries

get_time_series(time_series_id)#

Return a handle to interact with the time series

Parameters:

time_series_id (str) – ID of the time series

Returns:

the corresponding time series object

Return type:

a GovernTimeSeries

get_uploaded_file(uploaded_file_id)#

Return a handle to interact with an uploaded file

Parameters:

uploaded_file_id (str) – ID of the uploaded file

Returns:

the corresponding uploaded file object

Return type:

a GovernUploadedFile

upload_file(file_name, file)#

Upload a file on Govern. Return a handle to interact with this new uploaded file.

Parameters:
  • file_name (str) – Name of the file

  • file (stream) – file contents, as a stream - file-like object

Returns:

the newly uploaded file object

Return type:

a GovernUploadedFile

list_users(as_objects=False)#

List all user setup on the Govern instance Note: this call requires an API key with admin rights

Returns:

A list of users, as a list of GovernUser if as_objects is True, else as a list of dicts

Return type:

list of GovernUser or list of dicts

get_user(login)#

Get a handle to interact with a specific user

Parameters:

login (str) – the login of the desired user

Returns:

A GovernUser user handle

create_user(login, password, display_name='', source_type='LOCAL', groups=None, profile='DATA_SCIENTIST')#

Create a user, and return a handle to interact with it

Note: this call requires an API key with admin rights

Parameters:
  • login (str) – the login of the new user

  • password (str) – the password of the new user

  • display_name (str) – the displayed name for the new user

  • source_type (str) – the type of new user. Admissible values are ‘LOCAL’ or ‘LDAP’

  • groups (list) – the names of the groups the new user belongs to (defaults to [])

  • profile (str) – The profile for the new user, can be one of READER, DATA_ANALYST or DATA_SCIENTIST

Returns:

A GovernUser user handle

get_own_user()#

Get a handle to interact with the current user

Returns:

A GovernOwnUser user handle

list_users_activity(enabled_users_only=False)#

List all users activity

Note: this call requires an API key with admin rights

Returns:

A list of user activity logs, as a list of dataikuapi.govern.admin.GovernUserActivity

Return type:

list of dataikuapi.govern.admin.GovernUserActivity

get_authorization_matrix()#

Get the authorization matrix for all enabled users and groups

Note: this call requires an API key with admin rights

Returns:

The authorization matrix

Return type:

A dataikuapi.govern.admin.GovernAuthorizationMatrix authorization matrix handle

start_resync_users_from_supplier(logins)#

Starts a resync of multiple users from an external supplier (LDAP, Azure AD or custom auth)

Parameters:

logins (list) – list of logins to resync

Returns:

a dataikuapi.govern.future.GovernFuture representing the sync process

Return type:

dataikuapi.govern.future.GovernFuture

start_resync_all_users_from_supplier()#

Starts a resync of all users from an external supplier (LDAP, Azure AD or custom auth)

Returns:

a dataikuapi.govern.future.GovernFuture representing the sync process

Return type:

dataikuapi.govern.future.GovernFuture

start_fetch_external_groups(user_source_type)#

Fetch groups from external source

Parameters:

user_source_type – ‘LDAP’, ‘AZURE_AD’ or ‘CUSTOM’

Return type:

dataikuapi.govern.future.GovernFuture

Returns:

a GovernFuture containing a list of group names

start_fetch_external_users(user_source_type, login=None, group_name=None)#
Fetch users from external source filtered by login or group name:
  • if login is provided, will search for a user with an exact match in the external source (e.g. before login remapping)

  • else,
    • if group_name is provided, will search for members of the group in the external source

    • else will search for all users

Parameters:
  • user_source_type – ‘LDAP’, ‘AZURE_AD’ or ‘CUSTOM’

  • login – optional - the login of the user in the external source

  • group_name – optional - the group name of the group in the external source

Return type:

dataikuapi.govern.future.GovernFuture

Returns:

a GovernFuture containing a list of ExternalUser

start_provision_users(user_source_type, users)#

Provision users of given source type

Parameters:
  • user_source_type (string) – ‘LDAP’, ‘AZURE_AD’ or ‘CUSTOM’

  • users (list) – list of user attributes coming form the external source

Return type:

dataikuapi.govern.future.GovernFuture

list_groups()#

List all groups setup on the Govern instance

Note: this call requires an API key with admin rights

Returns:

A list of groups, as a list of dicts

Return type:

list of dicts

get_group(name)#

Get a handle to interact with a specific group

Parameters:

name (str) – the name of the desired group

Returns:

A GovernGroup group handle

create_group(name, description=None, source_type='LOCAL')#

Create a group, and return a handle to interact with it

Note: this call requires an API key with admin rights

Parameters:
  • name (str) – the name of the new group

  • description (str) – (optional) a description of the new group

  • source_type (str) – the type of the new group. Admissible values are ‘LOCAL’ and ‘LDAP’

Returns:

A GovernGroup group handle

list_global_api_keys()#

List all global API keys set up on the Govern instance

Note: this call requires an API key with admin rights

Returns:

All global API keys, as a list of dicts

get_global_api_key(key)#

Get a handle to interact with a specific Global API key

Parameters:

key (str) – the secret key of the desired API key

Returns:

A GovernGlobalApiKey API key handle

create_global_api_key(label=None, description=None, admin=False)#

Create a Global API key, and return a handle to interact with it

Note: this call requires an API key with admin rights

Parameters:
  • label (str) – the label of the new API key

  • description (str) – the description of the new API key

  • admin (boolean) – has the new API key admin rights (True or False)

Returns:

A GovernGlobalApiKey API key handle

list_logs()#

List all available log files on the Govern instance This call requires an API key with admin rights

Returns:

A list of log file names

get_log(name)#

Get the contents of a specific log file This call requires an API key with admin rights

Parameters:

name (str) – the name of the desired log file (obtained with list_logs())

Returns:

The full content of the log file, as a string

log_custom_audit(custom_type, custom_params=None)#

Log a custom entry to the audit trail

Parameters:
  • custom_type (str) – value for customMsgType in audit trail item

  • custom_params (dict) – value for customMsgParams in audit trail item (defaults to {})

get_general_settings()#

Gets a handle to interact with the general settings.

This call requires an API key with admin rights

Returns:

a GovernGeneralSettings handle

get_auth_info()#

Returns various information about the user currently authenticated using this instance of the API client.

This method returns a dict that may contain the following keys (may also contain others):

  • authIdentifier: login for a user, id for an API key

  • groups: list of group names (if context is a user)

Returns:

a dict

Return type:

dict

get_licensing_status()#

Returns a dictionary with information about licensing status of this Govern instance

Return type:

dict

set_license(license)#

Sets a new licence for Govern

Parameters:

license (str) – license (content of license file)

Returns:

None

get_instance_info()#

Get global information about the Govern instance

Returns:

a GovernInstanceInfo

class dataikuapi.govern.blueprint.GovernBlueprintListItem(client, data)#

An item in a list of blueprints. Do not create this directly, use list_blueprints()

get_raw()#

Get the raw content of the blueprint list item

Returns:

the raw content of the blueprint list item as a dict

Return type:

dict

to_blueprint()#

Gets the GovernBlueprint corresponding to this blueprint object

Returns:

the blueprint object

Return type:

a GovernBlueprint

class dataikuapi.govern.blueprint.GovernBlueprint(client, blueprint_id)#

A handle to read a blueprint on the Govern instance. If you wish to edit blueprints or the blueprint versions, use the blueprint designer object GovernAdminBlueprintDesigner. Do not create this directly, use get_blueprint()

get_definition()#

Return the definition of the blueprint as an object.

Returns:

The blueprint definition as an object.

Return type:

GovernBlueprintDefinition

list_versions()#

List versions of this blueprint.

Returns:

the list of blueprint versions

Return type:

list of GovernBlueprintVersionListItem

get_version(version_id)#

Return a handle to interact with a blueprint version

Parameters:

version_id (str) – ID of the version

Return type:

GovernBlueprintVersion

class dataikuapi.govern.blueprint.GovernBlueprintDefinition(client, blueprint_id, definition)#

The definition of a blueprint. Do not create this class directly, instead use get_definition()

get_raw()#

Get raw definition of a blueprint

Returns:

The raw definition of blueprint, as a dict.

Return type:

dict

class dataikuapi.govern.blueprint.GovernBlueprintVersionListItem(client, blueprint_id, data)#

An item in a list of blueprint versions. Do not create this directly, use list_versions()

get_raw()#

Get the raw content of the blueprint version list item

Returns:

the raw content of the blueprint version list item as a dict

Return type:

dict

to_blueprint_version()#

Gets the GovernBlueprintVersion corresponding to this blueprint version object

Returns:

the blueprint object

Return type:

a GovernBlueprintVersion

class dataikuapi.govern.blueprint.GovernBlueprintVersion(client, blueprint_id, version_id)#

A handle to interact with a blueprint version on the Govern instance. Do not create this directly, use get_version()

get_blueprint()#

Retrieve the blueprint handle of this blueprint version.

Returns:

the corresponding blueprint handle

Return type:

GovernBlueprint

get_trace()#

Get the trace of this blueprint version (info about its status and origin blueprint version lineage).

Returns:

The trace of this blueprint version.

Return type:

GovernBlueprintVersionTrace

get_definition()#

Get the definition of this blueprint version.

Returns:

The definition of the blueprint version as an object.

Return type:

GovernBlueprintVersionDefinition

class dataikuapi.govern.blueprint.GovernBlueprintVersionTrace(client, blueprint_id, version_id, trace)#

The trace of a blueprint version containing information about its lineage and its status. Do not create this directly, use get_trace()

get_raw()#

Get raw trace of the blueprint version.

Returns:

The raw trace of blueprint version, as a dict.

Return type:

dict

property status#

Get the status of the blueprint version among (DRAFT, ACTIVE, or ARCHIVED)

Return type:

str

property origin_version_id#

Get the origin version ID of this blueprint version

Return type:

str

class dataikuapi.govern.blueprint.GovernBlueprintVersionDefinition(client, blueprint_id, version_id, definition)#

The definition of a blueprint version. Do not create this directly, use get_definition()

get_raw()#

Get raw definition of the blueprint version.

Returns:

The raw definition of blueprint version, as a dict.

Return type:

dict

class dataikuapi.govern.artifact.GovernArtifact(client, artifact_id)#

A handle to interact with an artifact on the Govern instance. Do not create this directly, use get_artifact()

get_definition()#

Retrieve the artifact definition and return it as an object.

Returns:

the corresponding artifact definition object

Return type:

GovernArtifactDefinition

list_signoffs()#

List all the sign-offs from the different steps of the workflow for this current artifact.

Returns:

the list of sign-offs

Return type:

list of GovernArtifactSignoffListItem

get_signoff(step_id)#

Get the sign-off for a specific step of the workflow for this current artifact.

Parameters:

step_id (str) – id of the step to retrieve the sign-off from

Returns:

the corresponding GovernArtifactSignoff

delete()#

Delete the artifact

Returns:

None

create_signoff(step_id)#

Create a sign-off for the given stepId. The step must be ongoing and must not hold an existing sign-off. Note: the sign-offs of all steps are created automatically when the artifact is created based on the blueprint version sign-off configurations; thus this call is useful when the configuration has been added after the creation of the artifact.

Returns:

the created GovernArtifactSignoff

class dataikuapi.govern.artifact.GovernArtifactDefinition(client, artifact_id, definition)#

The definition of an artifact. Do not create this class directly, instead use get_definition()

get_blueprint_version()#

Retrieve the blueprint version handle of this artifact

Returns:

the blueprint version handle

Return type:

GovernBlueprintVersion

get_raw()#

Get the raw content of the artifact. This returns a reference to the artifact so changes made to the returned object will be reflected when saving.

Return type:

dict

save()#

Save this settings back to the artifact.

class dataikuapi.govern.artifact.GovernArtifactSignoffListItem(client, artifact_id, data)#

An item in a list of sign-offs. Do not create this directly, use list_signoffs()

get_raw()#

Get the raw content of the sign-off list item

Returns:

the raw content of the sign-off list item as a dict

Return type:

dict

to_signoff()#

Gets the GovernArtifactSignoff corresponding to this sign-off object

Returns:

the sign-off object

Return type:

a GovernArtifactSignoff

class dataikuapi.govern.artifact.GovernArtifactSignoff(client, artifact_id, step_id)#

Handle to interact with the sign-off of a specific workflow step. Do not create this directly, use get_signoff()

get_definition()#

Get the definition of the sign-off for this specific workflow step.

Returns:

the sign-off definition

Return type:

GovernArtifactSignoffDefinition

get_recurrence_configuration()#

Get the recurrence configuration of the sign-off for this specific workflow step.

Returns:

the sign-off recurrence configuration

Return type:

GovernArtifactSignoffRecurrenceConfiguration

get_details()#

Get the sign-off details for this specific workflow step. This contains a list of computed users included in feedback groups and in the approval.

Returns:

sign-off details

Return type:

GovernArtifactSignoffDetails

update_status(signoff_status, users_to_notify=None, reload_conf_for_reset=False)#

Change the status of the sign-off, takes as input the target status, optionally a list of users to notify and a boolean to indicate if the sign-off configuration should be updated from the blueprint version. Only the users included in the groups of feedback and approval are able to give feedback or approval and can be notified, the complete list is available using: get_details(). For the feedback, the users will be notified as part of a chosen group of feedback and the group must be specified.

Parameters:
  • signoff_status (str) – target feedback status to be chosen from: NOT_STARTED, WAITING_FOR_FEEDBACK, WAITING_FOR_APPROVAL, APPROVED, REJECTED, ABANDONED

  • users_to_notify (list of dict) – (Optional) List of the user to notify as part of the status change (WAITING_FOR_FEEDBACK will involve the feedback groups, WAITING_FOR_APPROVAL will involve the final approval). The list should be a list of dict containing two keys “userLogin” and “groupId” for each user to notify. The “groupId” key is mandatory for feedback notification and forbidden for the final approval notification. All users that are not in the sign-off configuration will be ignored.

  • reload_conf_for_reset (boolean) – (Optional, defaults to False) Usefull only when the target status is NOT_STARTED. If True the current sign-off configuration will be overwritten by the one coming from the blueprint version, all delegated users will be reset. If False the current sign-off configuration will remain the same, allowing all delegated users to be retained but any changes to the sign-off configuration in the blueprint version will not be reflected.

Returns:

None

list_feedbacks()#

List all the feedbacks of this current sign-off.

Returns:

the list of feedbacks

Return type:

list of GovernArtifactSignoffFeedbackListItem

get_feedback(feedback_id)#

Get a specific feedback review of this sign-off.

Parameters:

feedback_id (str) – ID of the feedback review to retrieve from the sign-off

Returns:

the corresponding GovernArtifactSignoffFeedback

add_feedback(group_id, feedback_status, comment=None)#

Add a feedback review for a specific feedback group of the sign-off. Takes as input a group_id (the feedback group id), a feedback status and an optional comment.

Parameters:
  • group_id (str) – ID of the feedback group

  • feedback_status (str) – feedback status to be chosen from: APPROVED, MINOR_ISSUE, MAJOR_ISSUE

  • comment (str) – (Optional) feedback comment

Return type:

a GovernArtifactSignoffFeedback

delegate_feedback(group_id, users_container)#

Delegate the feedback to specific users for the sign-off. Takes as input a group_id (the feedback group that should have done the feedback originally), and an users container definition to delegate to.

Parameters:
  • group_id (str) – ID of the feedback group

  • users_container (dict) – a dict representing the users to delegate to. Use build() to build a users container definition for a single user.

Returns:

None

get_approval()#

Get the current approval of this sign-off.

Returns:

the corresponding GovernArtifactSignoffApproval

add_approval(approval_status, comment=None)#

Add the final approval of the sign-off. Takes as input an approval status and an optional comment.

Parameters:
  • approval_status (str) – approval status to be chosen from: APPROVED, REJECTED, ABANDONED

  • comment (str) – (Optional) approval comment

Return type:

a GovernArtifactSignoffApproval

delegate_approval(users_container)#

Delegate the approval to specific users of the sign-off. Takes as input an users container definition to delegate to.

Parameters:

users_container (str) – a dict representing the users to delegate to. Use build() to build a users container definition for a single user.

Returns:

None

class dataikuapi.govern.artifact.GovernArtifactSignoffDefinition(client, artifact_id, step_id, definition)#

The definition of a sign-off. Do not create this class directly, instead use get_definition()

get_raw()#

Get the raw content of the sign-off definition.

Return type:

dict

class dataikuapi.govern.artifact.GovernArtifactSignoffRecurrenceConfiguration(client, artifact_id, step_id, recurrence_configuration)#

The recurrence configuration of a sign-off. Do not create this class directly, instead use get_recurrence_configuration()

get_raw()#

Get the raw content of the sign-off recurrence configuration. This returns a reference that can be modified to be saved later. The returned dict can be empty if the recurrence configuration was not already configured.

Return type:

dict

save()#

Save the recurrence configuration back to the sign-off. The recurrence configuration must have the following properties:

  • activated (boolean)

  • days (int)

  • weeks (int)

  • months (int)

  • years (int)

  • reloadConf (boolean)

Returns:

None

class dataikuapi.govern.artifact.GovernArtifactSignoffDetails(client, artifact_id, step_id, details)#

The details of a sign-off. Do not create this class directly, instead use get_details()

get_raw()#

Get the raw content of the sign-off details.

Return type:

dict

class dataikuapi.govern.artifact.GovernArtifactSignoffFeedbackListItem(client, artifact_id, step_id, feedback_id, data)#

An item in a list of feedback reviews. Do not create this directly, use list_feedbacks()

get_raw()#

Get the raw content of the feedback review.

Return type:

dict

to_feedback()#

Gets the GovernArtifactSignoffFeedback corresponding to this feedback object

Returns:

the feedback object

Return type:

a GovernArtifactSignoffFeedback

class dataikuapi.govern.artifact.GovernArtifactSignoffFeedback(client, artifact_id, step_id, feedback_id)#

Handle to interact with a feedback. Do not create this directly, use get_feedback()

get_definition()#

Get the feedback definition.

Returns:

the feedback definition object

Return type:

a GovernArtifactSignoffFeedbackDefinition

delete()#

Delete this feedback review

Returns:

None

class dataikuapi.govern.artifact.GovernArtifactSignoffFeedbackDefinition(client, artifact_id, step_id, feedback_id, definition)#

The definition of a feedback review. Do not create this directly, use get_definition()

get_raw()#

Get the raw content of the feedback definition. This returns a reference to the feedback so changes made to the status and comment properties will be reflected when saving.

Return type:

dict

save()#

Save this feedback review back to the sign-off

Returns:

None

class dataikuapi.govern.artifact.GovernArtifactSignoffApproval(client, artifact_id, step_id)#

Handle to interact with an approval. Do not create this directly, use get_approval()

get_definition()#

Get the approval definition.

Returns:

the approval definition object

Return type:

a GovernArtifactSignoffApprovalDefinition

delete()#

Delete this approval.

Returns:

None

class dataikuapi.govern.artifact.GovernArtifactSignoffApprovalDefinition(client, artifact_id, step_id, definition)#

The definition of an approval. Do not create this directly, use get_definition()

get_raw()#

Get the raw content of the approval. This returns a reference to the approval so changes made to the status and comment properties will be reflected when saving.

Return type:

dict

save()#

Save this approval back to the sign-off

Returns:

None

class dataikuapi.govern.uploaded_file.GovernUploadedFile(client, uploaded_file_id)#

A handle to interact with an uploaded file Do not create this directly, use get_uploaded_file()

get_description()#

Get the description of the uploaded file.

Returns:

The description of the file as a python dict

Return type:

dict

download()#

Download the uploaded file

Returns:

the uploaded file contents, as a stream - file-like object

Return type:

a stream - file-like object

delete()#

Delete the file

Returns:

None

class dataikuapi.govern.time_series.GovernTimeSeries(client, time_series_id)#

A handle to interact with a time series. Do not create this directly, use get_time_series()

get_values(min_timestamp=None, max_timestamp=None)#

Get the values of the time series. Use the parameters min_timestamp and max_timestamp to define a time window. Only values within this window will be returned

Parameters:
  • min_timestamp (int) – (Optional) The minimum timestamp of the time window as an epoch in milliseconds

  • max_timestamp (int) – (Optional) The maximum timestamp of the time window as an epoch in milliseconds

Returns:

a list data points of the time series as Python dict

Return type:

list of dict

push_values(datapoints, upsert=True)#

Push a list of values inside the time series.

Parameters:
  • datapoints (list) – a list of Python dict - The list of datapoints as Python dict containing the following keys “timeSeriesId”, “timestamp” (an epoch in milliseconds), and “value” (an object)

  • upsert (boolean) – (Optional) If set to false, values for existing timestamps will not be overridden. Default value is True.

Returns:

None

delete(min_timestamp=None, max_timestamp=None)#

Delete the values of the time series. Use the parameters min_timestamp and max_timestamp to define a time window. Only values within this window will be deleted.

Parameters:
  • min_timestamp (int) – (Optional) The minimum timestamp of the time window as an epoch in milliseconds

  • max_timestamp (int) – (Optional) The maximum timestamp of the time window as an epoch in milliseconds

Returns:

None

class dataikuapi.govern.artifact_search.GovernArtifactSearchRequest(client, artifact_search_query)#

A search request object. Do not create this directly, use new_artifact_search_request() and then run the query using fetch_next_batch()

fetch_next_batch(page_size=20)#

Run the search request fetching the next batch of results. Use page_size to specify the size of the result page.

Parameters:

page_size (int) – (Optional) size of the result page, default value is set to 20.

Returns:

The response of a single fetch of the search request

Return type:

a GovernArtifactSearchResponse

class dataikuapi.govern.artifact_search.GovernArtifactSearchResponse(client, response)#

A search request response for a single batch. Do not create this directly, use fetch_next_batch().

get_raw()#

Get the raw content of the search response

Returns:

the raw content of the search response as a dict

Return type:

dict

get_response_hits()#

Get the search response hits (artifacts)

Returns:

list of the search response hits (artifacts)

Return type:

list of GovernArtifactSearchResponseHit

class dataikuapi.govern.artifact_search.GovernArtifactSearchResponseHit(client, hit)#

A search request response. Do not create this directly, use get_response_hits().

get_raw()#

Get the raw content of the search response hit

Returns:

the raw content of the search response hit as a dict

Return type:

dict

to_artifact()#

Gets the GovernArtifact corresponding to this search response hit

Returns:

the custom page object

Return type:

a GovernArtifact

class dataikuapi.govern.artifact_search.GovernArtifactSearchQuery(artifact_search_source=None, artifact_filters=None, artifact_search_sort=None)#

A definition of an artifact query. Instantiate and interact with this object to customize the query.

Parameters:
set_artifact_search_source(artifact_search_source)#

Set a search source for this query

Parameters:

artifact_search_source (GovernArtifactSearchSource) – (Optional) The search source to target a subset of artifacts. For now, by default, the search will be executed on all artifacts using the GovernArtifactSearchSourceAll search source.

Returns:

None

clear_artifact_filters()#

Remove the filters set for this query

Returns:

None

add_artifact_filter(artifact_filter)#

Add a new artifact filter to the filter list of the query.

Parameters:

artifact_filter (GovernArtifactFilter) – A filter to add to the filter list.

Returns:

None

clear_artifact_search_sort()#

Remove the sort configuration of this query.

Returns:

None

set_artifact_search_sort(artifact_search_sort)#

Set a new search sort configuration for this request.

Parameters:

artifact_search_sort (GovernArtifactSearchSort) – The sort configuration to apply on the query

Returns:

None

build()#
Returns:

the search query definition

Return type:

(dict, dict)

class dataikuapi.govern.artifact_search.GovernArtifactSearchSource(search_source_type)#

An abstract class to represent the different search source. Do not instantiate this class but one of its subclasses.

build()#
class dataikuapi.govern.artifact_search.GovernArtifactSearchSourceAll#

A generic search source definition.

build()#
Returns:

the search source definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactSearchSort(artifact_search_sort_type, direction)#

An abstract class to represent the different search sort. Do not instantiate this class but one of its subclasses.

build()#
class dataikuapi.govern.artifact_search.GovernArtifactSearchSortName(direction='ASC')#

An artifact sort definition based on their names.

Parameters:

direction (str) – (Optional) The direction on which the artifacts will be sorted. Can be either “ASC” or “DESC”

build()#
Returns:

the search sort definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactSearchSortWorkflow(direction='ASC')#

An artifact sort defintion based on their workflow.

Parameters:

direction (str) – (Optional) The direction on which the artifacts will be sorted. Can be either “ASC” or “DESC”

build()#
Returns:

the search sort definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactSearchSortField(fields=None, direction='ASC')#

An artifact sort definition based on a list of fields.

Parameters:
  • fields (list of dict) – (Optional) A list of fields on which the artifacts will be sorted. Use build() to build a field based sort definition.

  • direction (str) – (Optional) The direction on which the artifacts will be sorted. Can be either “ASC” or “DESC”

build()#
Returns:

the search sort definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactSearchSortFieldDefinition(blueprint_id, field_id)#

A field sort definition builder to use in a search query in order to sort on a field of a blueprint.

Parameters:
  • blueprint_id (str) – the Blueprint ID

  • field_id (str) – the field ID

build()#
Returns:

the field search sort definition

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactFilter(filter_type)#

An abstract class to represent artifact filters. Do not instance this class but one of its subclasses.

build()#
class dataikuapi.govern.artifact_search.GovernArtifactFilterBlueprints(blueprint_ids=None)#

An artifact filter definition based on a list of specific blueprints.

Parameters:
  • blueprint_ids – (Optional) the list of blueprint IDs to use to filter the artifacts

  • blueprint_ids – lsit of str

build()#
Returns:

the artifact filter definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactFilterBlueprintVersions(blueprint_version_ids=None)#

An artifact filter definition based on a list of specific blueprint versions.

Parameters:

blueprint_version_ids (list of dict) – (Optional) the list of blueprint version IDs to use to filter the artifacts. A blueprint version ID definition is a dict composed of the blueprint ID and the version ID like the following dict: {“blueprintId”: “bp.my_blueprint”, “versionId”: “bv.my_version”}. You can use build() to build a blueprint version ID definition directly. At the end, the blueprint_version_ids parameter expects a value looking like this: [{“blueprintId”: “bp.my_blueprint”, “versionId”: “bv.my_version”}, {“blueprintId”: “bp.my_blueprint”, “versionId”: “bv.my_version2”}.

build()#
Returns:

the artifact filter definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactFilterArtifacts(artifact_ids=None)#

An artifact filter definition based on a list of specific artifacts.

Parameters:

artifact_ids (list of str) – (Optional) the list of artifacts IDs to use to filter the artifacts.

build()#
Returns:

the artifact filter definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactFilterFieldValue(condition_type, condition=None, field_id=None, negate_condition=None, case_sensitive=None)#

An artifact filter definition based on specific fields value.

Parameters:
  • condition_type (str) – the condition type of the filter. Has to be chosen from EQUALS, CONTAINS, START_WITH, END_WITH.

  • condition (str) – (Optional) The value on which the condition will be applied.

  • field_id (str) – (Optional) The ID of the field on which the condition will be applied. If not specified the filter will apply on the name.

  • negate_condition (boolean) – (Optional) A boolean to negate the condition. By default, the condition is not negated.

  • case_sensitive (str) – (Optional) Can be used to activate case-sensitive filtering. By default, filters will not be case-sensitive.

build()#
Returns:

the artifact filter definition as a dict

Return type:

dict

class dataikuapi.govern.artifact_search.GovernArtifactFilterArchivedStatus(is_archived)#

An artifact filter definition based on the archived status.

Parameters:

is_archived (boolean) – the value for filtering. If is_archived is set to True, all artifacts including archived ones will be part of the search result

build()#
Returns:

the artifact filter definition as a dict

Return type:

dict

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprintDesigner(client)#

Handle to interact with the blueprint designer Do not create this directly, use get_blueprint_designer()

list_blueprints()#

List blueprints

Returns:

the list of blueprints

Return type:

list of GovernAdminBlueprintListItem

get_blueprint(blueprint_id)#

Get a specific blueprint.

Parameters:

blueprint_id (str) – the ID of the blueprint

Returns:

a blueprint object

Return type:

GovernAdminBlueprint

create_blueprint(new_identifier, blueprint)#

Create a new blueprint and returns a handle to interact with it.

Parameters:
  • new_identifier (str) – the new identifier for the blueprint. Allowed characters are letters, digits, hyphen, and underscore.

  • blueprint (dict) – the blueprint definition

Returns:

The handle for the newly created blueprint

Return type:

GovernAdminBlueprint

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprintListItem(client, data)#

An item in a list of blueprints. Do not create this directly, use list_blueprints()

get_raw()#

Get the raw content of the blueprint list item

Returns:

the raw content of the blueprint list item as a dict

Return type:

dict

to_blueprint()#

Gets the GovernAdminBlueprint corresponding to this blueprint object

Returns:

the blueprint object

Return type:

a GovernAdminBlueprint

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprint(client, blueprint_id)#

A handle to interact with a blueprint as an admin on the Govern instance. Do not create this directly, use get_blueprint()

get_definition()#

Get the definition of the blueprint as an object. To modify the definition, call save() on the returned object.

Returns:

The blueprint definition as an object.

Return type:

GovernAdminBlueprintDefinition

list_versions()#

List versions of this blueprint.

Returns:

The list of the versions of the blueprint

Return type:

list of GovernAdminBlueprintVersionListItem

create_version(new_identifier, name=None, origin_version_id=None)#

Create a new blueprint version and returns a handle to interact with it.

Parameters:
  • new_identifier (str) – The new identifier of the blueprint version. Allowed characters are letters, digits, hyphen, and underscore.

  • name (str) – (Optional) The name of the blueprint version.

  • origin_version_id (str) – (Optional) The blueprint version ID of the origin version ID if there is one.

Returns:

The handle of the newly created blueprint

Return type:

GovernAdminBlueprintVersion

get_version(version_id)#

Get a blueprint version and return a handle to interact with it.

Parameters:

version_id (str) – ID of the version

Return type:

GovernAdminBlueprintVersion

delete()#

Delete the blueprint. To delete a blueprint, all related blueprint versions and artifacts must be deleted beforehand.

Returns:

None

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprintDefinition(client, blueprint_id, definition)#

The definition of a blueprint. Do not create this class directly, instead use get_definition()

get_raw()#

Get raw definition of the blueprint

Returns:

the raw definition of blueprint, as a dict. Modifications made to the returned object are reflected when saving

Return type:

dict

save()#

Save this settings back to the blueprint.

Returns:

None

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprintVersionListItem(client, blueprint_id, data)#

An item in a list of blueprint versions. Do not create this directly, use list_versions()

get_raw()#

Get the raw content of the blueprint version list item

Returns:

the raw content of the blueprint version list item as a dict

Return type:

dict

to_blueprint_version()#

Gets the GovernAdminBlueprintVersion corresponding to this blueprint version object

Returns:

the blueprint object

Return type:

a GovernAdminBlueprintVersion

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprintVersion(client, blueprint_id, version_id)#

A handle to interact with a blueprint version. Do not create this directly, use get_version()

get_definition()#

Get the definition of this blueprint version. To modify the definition, call save() on the returned object.

Returns:

The definition of the blueprint version as an object.

Return type:

GovernAdminBlueprintVersionDefinition.

get_trace()#

Get a handle of the blueprint version trace containing information about its lineage and its status.

Returns:

the trace of the blueprint version.

Return type:

GovernAdminBlueprintVersionTrace.

list_signoff_configurations()#

Get the blueprint sign-off configurations of this blueprint version.

Returns:

The list of sign-off configurations

Return type:

list of GovernAdminSignoffConfigurationListItem

get_signoff_configuration(step_id)#

Get the sign-off configurations for a specific step

Parameters:

step_id (str) – The step ID of the sign-off

Returns:

The sign-off configuration as an object

Return type:

a GovernAdminSignoffConfiguration

create_signoff_configuration(step_id, signoff_configuration)#

Create a new sign-off for a specific step of the workflow and return a handle to interact with it.

Parameters:
  • step_id (str) – The step ID of the workflow on which the sign-off will be added.

  • signoff_configuration (dict) – The configuration of the sign-off

Returns:

The newly created sign-off configuration as an object

Return type:

GovernAdminSignoffConfiguration

delete()#

Delete the blueprint version. To delete a blueprint, all related artifacts must be deleted beforehand.

Returns:

None

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprintVersionDefinition(client, blueprint_id, version_id, definition)#

The blueprint version definition. Do not create this directly, use get_definition()

get_raw()#

Get raw definition of the blueprint version.

Returns:

the raw definition of blueprint version, as a dict. Modifications made to the returned object are reflected when saving

Return type:

dict

save(danger_zone_accepted=None)#

Save this definition back to the blueprint version definition.

Parameters:

danger_zone_accepted (boolean) – ignore the warning about existing artifacts. If there are existing artifacts using this blueprint version, modifying it may break them (ie. removing artifact field values). By default, the save call will fail in this case. If this parameter is set to true, the call will ignore the warning and be run anyway.

Returns:

None

class dataikuapi.govern.admin_blueprint_designer.GovernAdminBlueprintVersionTrace(client, blueprint_id, version_id, trace)#

The trace of a blueprint version containing information about its lineage and its status. Do not create this directly, use get_trace()

get_raw()#

Get raw trace of the blueprint version.

Returns:

The raw trace of blueprint version, as a dict.

Return type:

dict

property status#

Get the status of the blueprint version among (DRAFT, ACTIVE, or ARCHIVED)

Return type:

str

property origin_version_id#

Get the origin version ID of this blueprint version

Return type:

str

set_status(status)#

Directly update the status of the blueprint version.

Parameters:

status (str) – DRAFT, ACTIVE, or ARCHIVED

Returns:

None

class dataikuapi.govern.admin_blueprint_designer.GovernAdminSignoffConfigurationListItem(client, blueprint_id, version_id, data)#

An item in a list of sign-off configurations. Do not create this directly, use list_signoff_configurations()

get_raw()#

Get the raw content of the sign-off configuration list item

Returns:

the raw content of the sign-off configuration list item as a dict

Return type:

dict

to_signoff_configuration()#

Gets the GovernAdminSignoffConfiguration corresponding to this sign-off configuration object

Returns:

the sign-off configuration object

Return type:

a GovernAdminSignoffConfiguration

class dataikuapi.govern.admin_blueprint_designer.GovernAdminSignoffConfiguration(client, blueprint_id, version_id, step_id)#

A handle to interact with the sign-off configuration of a specific step of a workflow. Do not create this directly, use get_signoff_configuration()

get_definition()#

Get the definition of the configuration, to modify the configuration call save() on the returned object.

Returns:

The blueprint definition as an object.

Return type:

GovernAdminSignoffConfigurationDefinition

delete()#

Delete the sign-off configuration.

Returns:

None

class dataikuapi.govern.admin_blueprint_designer.GovernAdminSignoffConfigurationDefinition(client, blueprint_id, version_id, step_id, definition)#

The definition of sign-off configuration. Do not create this class directly, instead use get_definition()

get_raw()#

Get raw definition of the sign-off configuration

Returns:

the raw configuration of the sign-off, as a dict. Modifications made to the returned object are reflected when saving

Return type:

dict

save()#

Save this settings back to the sign-off configuration.

Returns:

None

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminRolesPermissionsHandler(client)#

Handle to edit the roles and permissions Do not create this directly, use get_roles_permissions_handler()

list_roles()#

List roles

Returns:

a list of roles

Return type:

list of GovernAdminRoleListItem

get_role(role_id)#

Return a specific role on the Govern instance

Parameters:

role_id (str) – Identifier of the role

Return type:

GovernAdminRole

create_role(new_identifier, role)#

Create a new role and returns the handle to interact with it.

Parameters:
  • new_identifier (str) – Identifier of the new role. Allowed characters are letters, digits, hyphen, and underscore.

  • role (dict) – The definition of the role.

Return type:

GovernAdminRole

list_role_assignments()#

List the blueprint role assignments

Returns:

A list of role assignments for each blueprint

Return type:

list of GovernAdminBlueprintRoleAssignmentsListItem

get_role_assignments(blueprint_id)#

Get the role assignments for a specific blueprint. Returns a handle to interact with it.

Parameters:

blueprint_id (str) – id of the blueprint

Returns:

A object representing the role assignments for this blueprint

Return type:

GovernAdminBlueprintRoleAssignments

create_role_assignments(role_assignments)#

Create a role assignments on the Govern instance and returns the handle to interact with it.

Parameters:

role_assignment (dict) – Blueprint permission as a dict

Returns:

The newly created role assignment.

Return type:

GovernAdminBlueprintRoleAssignments

get_default_permissions_definition()#

Get the default permissions definition.

Returns:

A permissions object

Return type:

GovernAdminDefaultPermissionsDefinition

list_blueprint_permissions()#

List blueprint permissions

Returns:

A list of blueprint permissions

Return type:

list of GovernAdminBlueprintPermissionsListItem

get_blueprint_permissions(blueprint_id)#

Get the permissions for a specific blueprint. Returns a handle to interact with the permissions

Parameters:

blueprint_id (str) – id of the blueprint for which you need the permissions

Returns:

A permissions object for the specific blueprint

Return type:

GovernAdminBlueprintPermissions

create_blueprint_permissions(blueprint_permission)#

Create blueprint permissions and returns the handle to interact with it.

Parameters:

blueprint_permission (dict) – Blueprint permission as a dict

Returns:

the newly created permissions object

Return type:

GovernAdminBlueprintPermissions

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminRoleListItem(client, data)#

An item in a list of roles. Do not create this directly, use list_roles()

get_raw()#

Get the raw content of the role list item

Returns:

the raw content of the role list item as a dict

Return type:

dict

to_role()#

Gets the GovernAdminRole corresponding to this role object

Returns:

the role object

Return type:

a GovernAdminRole

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminRole(client, role_id)#

A handle to interact with the roles of the instance as an admin. Do not create this directly, use get_role()

get_definition()#

Return the information of the role as an object

Returns:

the information of the role.

Return type:

GovernAdminRoleDefinition

delete()#

Delete the role

Returns:

None

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminRoleDefinition(client, role_id, definition)#

The definition of a specific role. Do not create this directly, use get_definition()

get_raw()#

Get raw information of the role.

Returns:

the raw definition of role, as a dict. Modifications made to the returned object are reflected when saving

Return type:

dict

save()#

Save this information back to the role

Returns:

None

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminBlueprintRoleAssignmentsListItem(client, data)#

An item in a list of blueprint role assignments. Do not create this directly, use list_role_assignments()

get_raw()#

Get the raw content of the blueprint role assignments list item

Returns:

the raw content of the blueprint role assignments list item as a dict

Return type:

dict

to_blueprint_role_assignments()#

Gets the GovernAdminBlueprintRoleAssignments corresponding to this blueprint role assignments object

Returns:

the blueprint role assignments object

Return type:

a GovernAdminBlueprintRoleAssignments

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminBlueprintRoleAssignments(client, blueprint_id)#

A handle to interact with the blueprint role assignments for a specific blueprint Do not create this directly, use get_role_assignments()

get_definition()#

Get the role assignments definition. Returns a handle to interact with it.

Returns:

The role assignments for a specific blueprint.

Return type:

GovernAdminBlueprintRoleAssignments

delete()#

Delete the role assignments for a specific blueprint.

Returns:

None

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminBlueprintRoleAssignmentsDefinition(client, blueprint_id, definition)#

The role assignments for a specific blueprint. Do not create this class directly, instead use get_definition()

get_raw()#

Get the raw content definition of the assignments for this blueprint. This returns a reference to the raw assignments, not a copy, so changes made to the returned object will be reflected when saving.

Return type:

dict

save()#

Save this role assignments.

Returns:

None

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminBlueprintPermissionsListItem(client, data)#

An item in a list of blueprint permissions. Do not create this directly, use list_blueprint_permissions()

get_raw()#

Get the raw content of the blueprint permissions list item

Returns:

the raw content of the blueprint permissions list item as a dict

Return type:

dict

to_blueprint_permissions()#

Gets the GovernAdminBlueprintPermissions corresponding to this blueprint permissions object

Returns:

the blueprint permissions object

Return type:

a GovernAdminBlueprintPermissions

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminBlueprintPermissions(client, blueprint_id)#

A handle to interact with blueprint permissions for a specific blueprint Do not create this directly, use get_blueprint_permissions()

get_definition()#

Get the blueprint permissions definition. Returns a handle to interact with it.

Returns:

The permissions definition for a specific blueprint.

Return type:

GovernAdminBlueprintPermissionsDefinition

delete()#

Delete the permissions for this blueprint and use default permissions instead.

Returns:

None

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminBlueprintPermissionsDefinition(client, blueprint_id, definition)#

The permissions for a specific blueprint. Do not create this class directly, instead use get_definition()

get_raw()#

Get the raw content of the permissions for this blueprint. This returns a reference to the raw permissions, not a copy, so changes made to the returned object will be reflected when saving.

Return type:

dict

save()#

Save this permission back to the blueprint permission definition.

Returns:

None

class dataikuapi.govern.admin_roles_permissions_handler.GovernAdminDefaultPermissionsDefinition(client, definition)#

The default permissions of the instance Do not create this directly, use get_default_permissions_definition()

get_raw()#

Get the raw content of the default permissions. This returns a reference to the raw permissions, not a copy, so changes made to the returned object will be reflected when saving.

Return type:

dict

save()#

Save the default permissions

Returns:

None

class dataikuapi.govern.admin.GovernUser(client, login)#

A handle for a user on the Govern instance. Do not create this object directly, use get_user() instead.

delete()#

Delete the user

get_settings()#

Get the settings of the user

Return type:

GovernUserSettings

get_activity()#

Gets the activity of the user.

Returns:

the user’s activity

Return type:

GovernUserActivity

get_client_as()#

Get a GovernClient that has the permissions of this user.

This allows administrators to impersonate actions on behalf of other users, in order to perform actions on their behalf

start_resync_from_supplier()#

Starts a resync of the user from an external supplier (LDAP, Azure AD or custom auth) :return: a dataikuapi.govern.future.GovernFuture representing the sync process :rtype: dataikuapi.govern.future.GovernFuture

class dataikuapi.govern.admin.GovernUserSettings(client, login, settings)#

Settings for a Govern user. Do not create this object directly, use GovernUser.get_settings() instead.

property enabled#

Whether this user is enabled

Return type:

boolean

property creation_date#

Get the creation date of the user as a datetime.datetime

Returns:

the creation date

Return type:

datetime.datetime or None

save()#

Saves the settings

get_raw()#
Returns:

the raw settings of the user, as a dict. Modifications made to the returned object are reflected when saving

Return type:

dict

class dataikuapi.govern.admin.GovernOwnUser(client)#

A handle to interact with your own user Do not create this object directly, use get_own_user() instead.

get_settings()#

Get your own settings

Return type:

GovernOwnUserSettings

class dataikuapi.govern.admin.GovernOwnUserSettings(client, settings)#

Settings for the current Govern user. Do not create this object directly, use GovernOwnUser.get_settings() instead.

save()#

Saves the settings back to the current user

get_raw()#
Returns:

the raw settings of the user, as a dict. Modifications made to the returned object are reflected when saving

Return type:

dict

class dataikuapi.govern.admin.GovernGroup(client, name)#

A group on the Govern instance. Do not create this object directly, use get_group() instead.

delete()#

Delete the group

get_definition()#

Get the group’s definition (name, description, admin abilities, type, ldap name mapping)

Returns:

the group’s definition, as a dict

set_definition(definition)#

Set the group’s definition.

You should only set_definition() using an object that you obtained through get_definition(), not create a new dict. :param: dict definition: the definition for the group, as a dict :return: a dict - the definition of the group :rtype: dict

class dataikuapi.govern.admin.GovernGeneralSettings(client)#

The general settings of the Govern instance. Do not create this object directly, use get_general_settings() instead.

save()#

Save the changes that were made to the settings on the Govern instance Note: this call requires an API key with admin rights

get_raw()#

Get the settings as a dictionary

class dataikuapi.govern.admin.GovernGlobalApiKey(client, key)#

A global API key on the Govern instance

delete()#

Delete the api key

Note: this call requires an API key with admin rights

get_definition()#

Get the API key’s definition

Note: this call requires an API key with admin rights

Returns:

a dict - the definition of the API key

Return type:

dict

set_definition(definition)#

Set the API key’s definition.

Note: this call requires an API key with admin rights

Param:

dict definition: the definition for the API key, as a dict

Returns:

a dict - the definition of the API key

Return type:

dict

class dataikuapi.govern.custom_page.GovernCustomPageListItem(client, data)#

An item in a list of custom pages. Do not create this directly, use list_custom_pages()

get_raw()#

Get the raw content of the custom page list item

Returns:

the raw content of the custom page list item as a dict

Return type:

dict

to_custom_page()#

Gets the GovernCustomPage corresponding to this custom page object

Returns:

the custom page object

Return type:

a GovernCustomPage

class dataikuapi.govern.custom_page.GovernCustomPage(client, custom_page_id)#

A handle to interact with a custom page. Do not create this directly, use get_custom_page()

get_definition()#

Get the definition of the custom page.

Returns:

the corresponding custom page definition object

Return type:

a GovernCustomPageDefinition

class dataikuapi.govern.custom_page.GovernCustomPageDefinition(client, custom_page_id, definition)#

The definition of a custom page. Do not create this directly, use get_definition()

get_raw()#
Returns:

the raw content of the custom page as a dict

Return type:

dict

class dataikuapi.govern.admin_custom_pages_handler.GovernAdminCustomPagesHandler(client)#

Handle to edit the custom pages Do not create this directly, use get_custom_pages_handler()

list_custom_pages()#

List custom pages

Returns:

A list of custom pages

Return type:

list of GovernAdminCustomPageListItem

get_custom_page(custom_page_id)#

Get a custom page

Parameters:

custom_page_id (str) – ID of the custom page to retrieve

Returns:

A custom page as an object

Return type:

GovernAdminCustomPage

create_custom_page(new_identifier, custom_page)#

Create a custom page

Parameters:
  • new_identifier (str) – the new identifier for this custom page. Allowed characters are letters, digits, hyphen, and underscore.

  • custom_page (dict) – the custom page definition.

Returns:

the handle of the created custom page

Return type:

GovernAdminCustomPage

get_custom_pages_order()#

Retrieves the order of display of the custom pages by their id

Returns:

the order of the pages

Return type:

list[string]

save_custom_pages_order(custom_pages_order)#

Update the order of display of the custom pages.

Parameters:

custom_pages_order – list[string] new custom pages order. Must contain ids of all the custom pages

Returns:

updated custom pages order

Return type:

list[string]

class dataikuapi.govern.admin_custom_pages_handler.GovernAdminCustomPageListItem(client, data)#

An item in a list of custom pages. Do not create this directly, use list_custom_pages()

get_raw()#

Get the raw content of the custom page list item

Returns:

the raw content of the custom page list item as a dict

Return type:

dict

to_custom_page()#

Gets the GovernAdminCustomPage corresponding to this custom page object

Returns:

the custom page object

Return type:

a GovernAdminCustomPage

class dataikuapi.govern.admin_custom_pages_handler.GovernAdminCustomPage(client, custom_page_id)#

A handle to interact with a custom page as an administrator. Do not create this directly, use get_custom_page()

get_definition()#

Get the definition of the custom page, to modify the definition call save() on the returned object.

Returns:

A custom page definition as an object

Return type:

GovernAdminCustomPageDefinition

delete()#

Delete the custom page

Returns:

None

class dataikuapi.govern.admin_custom_pages_handler.GovernAdminCustomPageDefinition(client, custom_page_id, definition)#

The definition of a custom page. Do not create this directly, use get_definition()

get_raw()#

Get the raw content of the custom page. This returns a reference to the custom page so changes made to the returned object will be reflected when saving.

Return type:

dict

save()#

Save this settings back to the custom page.

Returns:

None

class dataikuapi.govern.blueprint.GovernBlueprintVersionId(blueprint_id, version_id)#

A Blueprint Version ID builder

Parameters:
  • blueprint_id (str) – the Blueprint ID

  • version_id (str) – the Version ID

build()#
Returns:

the built blueprint version ID definition

Return type:

dict

class dataikuapi.govern.users_container.GovernUsersContainer(type)#

An abstract class to represent a users container definition. Do not instance this class but one of its subclasses.

build()#
class dataikuapi.govern.users_container.GovernUserUsersContainer(user_login)#

A users container representing a single user

Parameters:

user_login (str) – the user login

build()#
Returns:

the users container definition as a dict

Return type:

dict