anatools.anaclient.graphs module

Staged Graphs Functions

create_staged_graph(self, name, channelId, graph, description=None, workspaceId=None)

Generates a new staged graph based off provided parameters. Must provide valid json string to create a new staged graph.

Parameters
  • name (str) – Name for the that will get generated.

  • channelId (str) – Id of channel to generate the staged graph with.

  • graph (str) – The graph as a dictionary or JSON string. While YAML files are used in channel development, the Platform SDK and API only support JSON. Ensure that the YAML file is valid in order for the yaml.safe_load to convert YAML to a dictionary for you. Otherwise, provide a graph in JSON format.

  • description (str) – Description of staged graph. Optional.

  • workspaceId (str) – Workspace ID create the staged graph in. If none is provided, the default workspace will get used.

Returns

The staged graph id if it was created sucessfully or an error message.

Return type

str

delete_staged_graph(self, graphId, workspaceId=None)

Delete a staged graph in a workspace.

Parameters
  • graphId (str) – Staged Graph id to delete.

  • workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.

Returns

A success or error message based on staged graph’s delete.

Return type

str

download_staged_graph(self, graphId, workspaceId=None)

Download a staged graph.

Parameters
  • graphId (str) – Graph ID of the staged graph to download.

  • workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the default workspace will get used.

Returns

A download URL that can be used in the browser or a failure message.

Return type

str

edit_staged_graph(self, graphId, description=None, name=None, workspaceId=None)

Update staged graph description and name.

Parameters
  • graphId (str) – Staged Graph id to update.

  • description (str) – New description to update.

  • name (str) – New name to update.

  • workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.

Returns

A success or error message based on staged graph’s update.

Return type

str

get_default_graph(self, channelId)

Gets the default graph for a channel.

Parameters

channelId – Id of channel to get the default graph for.

Returns

json data representing the graph.

Return type

json

get_staged_graphs(self, graphId=None, name=None, email=None, workspaceId=None)

Queries the workspace staged graphs based off provided parameters. Checks on graphId, name, or owner in this respective order within the specified workspace. If only workspace ID is provided, this will return all the staged graphs in a workspace.

Parameters
  • graphid (str) – Staged GraphID to filter on. Optional.

  • name (str) – Name of the staged graph to filter on. Optional.

  • email (str) – Owner of staged graphs to filter on. Optional.

  • workspaceId (str) – Workspace ID to filter on. If none is provided, the default workspace will get used.

Returns

A list of staged graphs based off provided query parameters if any parameters match.

Return type

list[dict]

set_default_graph(self, channelId, workspaceId, graphId=None, stagedGraphId=None)

Sets the default graph for a channel. User must be in the organization that manages the channel.

Parameters
  • channel (str) – The name of the channel to update the default graph.

  • workspaceId (str) – The ID of the Workspace that the graph is in.

  • graphId (str) – The ID of the graph that you want to be the default for the channel. Optional.

  • stagedGraphId (str) – The ID of the staged graph that you want to be the default for the channel. Optional.

Returns

Status

Return type

str