anatools.client.graphs module¶
Graphs Functions
- anatools.client.graphs.create_graph(self, name, channel, graph, description=None, workspaceId=None)¶
Generates a new graph based off provided parameters.
- Parameters
name (str) – Graph name that will get generated.
channel (str) – Name of channel to generate the graph with.
graph (json) – Location of yaml file. Check out the readme for more details (step 3 for how to use ana)
description (str) – Description of graph. Optional.
workspaceId (str) – Workspace ID create the graph in. If none is provided, the default workspace will get used.
- Returns
The graph id if it was created sucessfully or an error message.
- Return type
str
- anatools.client.graphs.delete_graph(self, graphId, workspaceId=None)¶
Delete a graph in a workspace.
- Parameters
graphId (str) – Graph id to delete.
workspaceId (str) – Workspace ID of the graph’s workspace. If none is provided, the current workspace will get used.
- Returns
A success or error message based on graph’s delete.
- Return type
str
- anatools.client.graphs.download_graph(self, graphId, workspaceId=None)¶
Download a graph.
- Parameters
graphId (str) – Graph ID of the graph to download.
workspaceId (str) – Workspace ID of the 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
- anatools.client.graphs.edit_graph(self, graphId, description=None, name=None, workspaceId=None)¶
Update graph description and name.
- Parameters
graphId (str) – Graph id to update.
description (str) – New description to update.
name (str) – New name to update.
workspaceId (str) – Workspace ID of the graph’s workspace. If none is provided, the current workspace will get used.
- Returns
A success or error message based on graph’s update.
- Return type
str
- anatools.client.graphs.get_default_graph(self, channel)¶
Gets the default graph for a channel.
- Parameters
channel – Name of channel to get the default graph for.
- Returns
json data representing the graph.
- Return type
json
- anatools.client.graphs.get_graphs(self, graphId=None, name=None, email=None, workspaceId=None)¶
Queries the workspace 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 graphs in a workspace.
- Parameters
graphid (str) – GraphID to filter on. Optional.
name (str) – Name of the graph to filter on. Optional.
email (str) – Owner of 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 graphs based off provided query parameters if any parameters match.
- Return type
list
- anatools.client.graphs.set_default_graph(self, channel, workspaceId, graphId)¶
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.
- Returns
Status
- Return type
str