apis

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 14 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.

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(userID string, 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

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 ClusterData

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

type ClusterDetails

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

type Data

type Data struct {
	ID         string    `json:"ID"`
	Username   string    `json:"Username"`
	CreatedAt  string    `json:"CreatedAt"`
	UserStatus string    `json:"UserStatus"`
	Email      string    `json:"Email"`
	FirstName  string    `json:"FirstName"`
	LastName   string    `json:"LastName"`
	Projects   []Project `json:"Projects"`
}

type Errors

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

type GetAgentDetails

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

type Member

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

type Payload

type Payload struct {
	AccessID  string `json:"access_id"`
	AccessKey string `json:"access_key"`
}

type Project

type Project struct {
	ID    string `json:"ID"`
	Name  string `json:"Name"`
	Owner struct {
		AccID   string `json:"AccID"`
		AccType string `json:"AccType"`
	} `json:"Owner"`
	Teams     []interface{} `json:"Teams"`
	State     interface{}   `json:"State"`
	CreatedAt string        `json:"CreatedAt"`
	UpdatedAt string        `json:"UpdatedAt"`
	RemovedAt string        `json:"RemovedAt"`
	Members   []Member      `json:"Members"`
}

type ProjectDetails

type ProjectDetails struct {
	Data Data `json:"data"`
}

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 UserAgentReg

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

Jump to

Keyboard shortcuts

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