apis

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright © 2021 The LitmusChaos Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(input types.AuthInput) (types.AuthResponse, error)

func CreateProjectRequest

func CreateProjectRequest(projectName string, cred types.Credentials) (createProjectResponse, error)

func ListProject

func ListProject(cred types.Credentials) (listProjectResponse, error)

func SendRequest

func SendRequest(params SendRequestParams, payload []byte, method string) (*http.Response, error)

func UpgradeAgent added in v0.5.0

func UpgradeAgent(c context.Context, cred types.Credentials, projectID string, clusterID string, kubeconfig string) (string, error)

Types

type AgentConnect

type AgentConnect struct {
	UserAgentReg UserAgentReg `json:"registerCluster"`
}

type AgentConnectionData

type AgentConnectionData struct {
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
	Data AgentConnect `json:"data"`
}

func ConnectAgent

func ConnectAgent(agent types.Agent, cred types.Credentials) (AgentConnectionData, error)

ConnectAgent connects the agent with the given details

type AgentData

type AgentData struct {
	Data   AgentList `json:"data"`
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
}

func GetAgentList

func GetAgentList(c types.Credentials, pid string) (AgentData, error)

GetAgentList lists the Chaos Delegate connected to the specified project

type AgentDetails

type AgentDetails struct {
	AgentName    string `json:"clusterName"`
	IsActive     bool   `json:"isActive"`
	IsRegistered bool   `json:"isRegistered"`
	ClusterID    string `json:"clusterID"`
}

type AgentList

type AgentList struct {
	GetAgent []AgentDetails `json:"listClusters"`
}

type ChaosWorkflowCreationData added in v0.11.0

type ChaosWorkflowCreationData struct {
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
	Data CreatedChaosWorkflow `json:"data"`
}

func CreateWorkflow added in v0.11.0

func CreateWorkflow(requestData model.ChaosWorkFlowRequest, cred types.Credentials) (ChaosWorkflowCreationData, error)

CreateWorkflow sends GraphQL API request for creating a workflow

type ClusterData added in v0.5.0

type ClusterData struct {
	Data   GetAgentDetails `json:"data"`
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
}

type ClusterDetails added in v0.5.0

type ClusterDetails struct {
	ClusterID      string  `json:"clusterID"`
	AccessKey      string  `json:"accessKey"`
	AgentNamespace *string `json:"agentNamespace"`
}

type CreateChaosWorkFlowGraphQLRequest added in v0.11.0

type CreateChaosWorkFlowGraphQLRequest struct {
	Query     string `json:"query"`
	Variables struct {
		CreateChaosWorkFlowRequest model.ChaosWorkFlowRequest `json:"request"`
	} `json:"variables"`
}

type CreatedChaosWorkflow added in v0.11.0

type CreatedChaosWorkflow struct {
	CreateChaosWorkflow model.ChaosWorkFlowResponse `json:"createChaosWorkFlow"`
}

type Data

type Data struct {
	ID       string    `json:"ID"`
	Projects []Project `json:"Projects"`
}

type DeleteChaosWorkflowData added in v0.11.0

type DeleteChaosWorkflowData struct {
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
	Data DeleteChaosWorkflowDetails `json:"data"`
}

func DeleteChaosWorkflow added in v0.11.0

func DeleteChaosWorkflow(projectID string, workflowID *string, cred types.Credentials) (DeleteChaosWorkflowData, error)

DeleteChaosWorkflow sends GraphQL API request for deleting a given Chaos Workflow.

type DeleteChaosWorkflowDetails added in v0.11.0

type DeleteChaosWorkflowDetails struct {
	IsDeleted bool `json:"deleteChaosWorkflow"`
}

type DeleteChaosWorkflowGraphQLRequest added in v0.11.0

type DeleteChaosWorkflowGraphQLRequest struct {
	Query     string `json:"query"`
	Variables struct {
		ProjectID     string  `json:"projectID"`
		WorkflowID    *string `json:"workflowID"`
		WorkflowRunID *string `json:"workflowRunID"`
	} `json:"variables"`
}

type DisconnectAgentData added in v0.11.0

type DisconnectAgentData struct {
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
	Data DisconnectAgentDetails `json:"data"`
}

func DisconnectAgent added in v0.11.0

func DisconnectAgent(projectID string, clusterIDs []*string, cred types.Credentials) (DisconnectAgentData, error)

DisconnectAgent sends GraphQL API request for disconnecting Chaos Delegate(s).

type DisconnectAgentDetails added in v0.11.0

type DisconnectAgentDetails struct {
	Message string `json:"deleteClusters"`
}

type DisconnectAgentGraphQLRequest added in v0.11.0

type DisconnectAgentGraphQLRequest struct {
	Query     string `json:"query"`
	Variables struct {
		ProjectID  string    `json:"projectID"`
		ClusterIDs []*string `json:"clusterIDs"`
	} `json:"variables"`
}

type Errors

type Errors struct {
	Message string   `json:"message"`
	Path    []string `json:"path"`
}

type GetAgentDetails added in v0.5.0

type GetAgentDetails struct {
	GetAgentDetails ClusterDetails `json:"getAgentDetails"`
}

type GetChaosWorkFlowRunsGraphQLRequest added in v0.11.0

type GetChaosWorkFlowRunsGraphQLRequest struct {
	Query     string `json:"query"`
	Variables struct {
		GetChaosWorkFlowRunsRequest model.ListWorkflowRunsRequest `json:"request"`
	} `json:"variables"`
}

type GetChaosWorkFlowsGraphQLRequest added in v0.11.0

type GetChaosWorkFlowsGraphQLRequest struct {
	Query     string `json:"query"`
	Variables struct {
		GetChaosWorkFlowsRequest model.ListWorkflowsRequest `json:"request"`
	} `json:"variables"`
}

type GetServerVersionData added in v0.12.0

type GetServerVersionData struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Member

type Member struct {
	Role     string `json:"Role"`
	UserID   string `json:"UserID"`
	UserName string `json:"UserName"`
}

type Payload

type Payload struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Project

type Project struct {
	ID        string   `json:"ID"`
	Name      string   `json:"Name"`
	CreatedAt string   `json:"CreatedAt"`
	Members   []Member `json:"Members"`
}

type ProjectDetails

type ProjectDetails struct {
	Data   Data `json:"data"`
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
}

func GetProjectDetails

func GetProjectDetails(c types.Credentials) (ProjectDetails, error)

GetProjectDetails fetches details of the input user

type SendRequestParams

type SendRequestParams struct {
	Endpoint string
	Token    string
}

type ServerVersionData added in v0.12.0

type ServerVersionData struct {
	GetServerVersion GetServerVersionData `json:"getServerVersion"`
}

type ServerVersionResponse added in v0.12.0

type ServerVersionResponse struct {
	Data   ServerVersionData `json:"data"`
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
}

func GetServerVersion added in v0.12.0

func GetServerVersion(endpoint string) (ServerVersionResponse, error)

GetServerVersion fetches the GQL server version

type UserAgentReg

type UserAgentReg struct {
	ClusterID   string `json:"clusterID"`
	ClusterName string `json:"clusterName"`
	Token       string `json:"token"`
}

type WorkflowList added in v0.11.0

type WorkflowList struct {
	ListWorkflowDetails model.ListWorkflowsResponse `json:"listWorkflows"`
}

type WorkflowListData added in v0.11.0

type WorkflowListData struct {
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
	Data WorkflowList `json:"data"`
}

func GetWorkflowList added in v0.11.0

GetWorkflowList sends GraphQL API request for fetching a list of workflows.

type WorkflowRunsList added in v0.11.0

type WorkflowRunsList struct {
	ListWorkflowRunsDetails model.ListWorkflowRunsResponse `json:"listWorkflowRuns"`
}

type WorkflowRunsListData added in v0.11.0

type WorkflowRunsListData struct {
	Errors []struct {
		Message string   `json:"message"`
		Path    []string `json:"path"`
	} `json:"errors"`
	Data WorkflowRunsList `json:"data"`
}

func GetWorkflowRunsList added in v0.11.0

GetWorkflowRunsList sends GraphQL API request for fetching a list of workflow runs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL