Govern Custom Pages Handler

Admins can manage custom pages.

Retrieve the definition of a custom page

import dataikuapi

host = "http(s)://DSS_HOST:DSS_PORT"
apiKey = "Your API key secret"
client = dataikuapi.GovernClient(host, apiKey)

# retrieve the custom pages handler
custom_pages_handler = client.get_custom_pages_handler()

# get a custom page by its ID
custom_page = custom_pages_handler.get_custom_page('cp.cust_page_1')

# get its definition
custom_page_def = custom_page.get_definition()

# print its definition
print(custom_page_def.get_raw())

Reference API doc

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

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