User service APIs

Contains operations for creating and managing projects and user preferences. Vianai recommends you use the upsert method when creating new projects to ensure project names are unique.

vianops_client.api.userservice.projects

class ProjectsV1Api(config: Config | None = None)

Bases: ConfiguredBaseApiClass

create(data: V1ProjectList, output_type: str = 'object') V1ProjectList

” Create projects

Parameters:

data (V1ProjectList) – Instance containing the data to create projects.

Returns:

Instance containing information about the created projects.

Return type:

V1ProjectList

delete(data: V1ProjectFilters, deletetype: str = 'archive', output_type: str = 'object') V1ProjectList

Delete projects

Parameters:
  • data (V1ProjectFilters) – Instance containing the the required data to select, and archive or delete the selected projects.

  • deletetype (str) – The deletion type. Supported values: archive, delete, force_delete. Default: archive.

Returns:

Instance containing response from project deletion.

Return type:

V1ProjectList

delete_url = '/v1/projects/{deletetype}'
search(data: V1ProjectSearch, output_type: str = 'object') V1ProjectsPage

Search for projects

Parameters:

data (V1ProjectSearch) – Instance containing the search criteria for projects.

Returns:

Instance containing the search results and pagination details.

Return type:

V1ProjectsPage

search_url = '/v1/projects/search'
update(data: V1ProjectUpdates, output_type: str = 'object') V1ProjectList

Update existing projects

Parameters:

data (V1ProjectUpdates) – Instance containing the data to update projects

Returns:

Instance containing the information about the updated projects.

Return type:

V1ProjectList

upsert(name: str, description: str | None = None, status: str | None = None, parent_project_uuid: str | None = None, overwrite: bool = True, output_type: str = 'object') V1Project | V1ProjectList

Create or update an existence project

Parameters:
  • name (str) – The name of the project.

  • description (str, optional) – The description of the project.

  • status (str, optional) – The status of the project.

  • parent_project_uuid (str, optional) – The UUID of the parent project, if any.

  • overwrite (bool, optional) – If True, existing project gets updated; otherwise, existing project is returned as is. (Default is True)

Returns:

Instance containing information about the project created or updated

Return type:

Union[V1Project, V1ProjectList]

url_suffix = '/v1/projects'

vianops_client.api.userservice.userpreference

class UserPreferenceV1Api(config: Config | None = None)

Bases: ConfiguredBaseApiClass

add_row(data: V1UserPreferenceBody)

Add a user configuration value

Parameters:

data (V1UserPreferenceBody) – Instance containing information about user configuration value to add.

Returns:

Response from adding a user configuration.

Return type:

dict # TODO check return type

delete_row(data: V1UserPreferenceDeleteRow)

Delete a user configuration value

Parameters:

data (V1UserPreferenceDeleteRow) – Instance containing the information that identifies the configuration to delete.

Returns:

Response from deleting user configuration.

Return type:

dict

get_table() V1UserPreferenceList

Retrieve all user configuration values

Returns:

Instance containing information about user configuration values.

Return type:

V1UserPreferenceList

get_value(filter_query: V1UserPreferenceGetValueModelRequest | None = None, output_type: str = 'object') V1GetValueModel

Retrieve a user configuration value

Parameters:

filter_query (V1UserPreferenceGetValueModelRequest, optional) – An instance of V1UserPreferenceGetValueModelRequest containing the filter query for the preferences. (Optional)

Returns:

Instance containing information about retrived user configuration value.

Return type:

V1GetValueModel

set_value(data: V1UserPreferenceBody)

Set the value of user configuration value

Parameters:

data (V1UserPreferenceBody) – Instance containing the data to set user configuration value.

Returns:

Response from setting user configuration value.

Return type:

dict

update_table(data: V1TableUpdatesBody)

Update user configuration values

Parameters:

data (V1TableUpdatesBody) – Instance containing information about user configuration values to update.

Returns:

Response from updating user configuration values.

Return type:

dict

url_suffix = '/v1/userpreference/'