api

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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.

Copyright paskal.maksim@gmail.com 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

View Source
var (
	Ctx = context.Background()
)

Functions

func CreateGitlabPipeline added in v0.3.1

func CreateGitlabPipeline(ns string, projectID string, branch string) (string, error)

func DeleteClusterRolesAndBindings added in v0.3.1

func DeleteClusterRolesAndBindings(ns string) error

delete all cluster role and bindings linken to namespace.

func DeleteGitlabRegistryTag added in v0.2.7

func DeleteGitlabRegistryTag(tag string, projectID string) error

DeleteRegistryTag deletes gitlab registry tag.

func DeleteNamespace added in v0.2.7

func DeleteNamespace(ns string) error

DeleteNamespace delete kubernetes namespace.

func DeletePod added in v0.2.7

func DeletePod(ns string, pod string, labelSelector string) error

DeletePod delete kubernetes pod by name or labelSelector.

func DisableHPA added in v0.2.7

func DisableHPA(ns string) error

func DisableMTLS added in v0.2.9

func DisableMTLS(ns string) error

func GetGitlabClient added in v0.3.1

func GetGitlabClient() *gitlab.Client

func GetLeaseLock added in v0.3.1

func GetLeaseLock(podNamespace string, podName string) (*resourcelock.LeaseLock, error)

func GetRunningPodsCount added in v0.2.7

func GetRunningPodsCount(ns string) (int, error)

GetRunningPodsCount get count of pods in namespace.

func Init added in v0.2.7

func Init() error

func RemoveOrphanedClusterRoles added in v0.3.1

func RemoveOrphanedClusterRoles() error

remove orphaned cluster role that not linked to namespace.

func SaveNamespaceAnnotation added in v0.2.9

func SaveNamespaceAnnotation(ns string, annotation map[string]string) error

saveNamespaceAnnotation annotation anotation in namespace.

func ScaleNamespace added in v0.2.7

func ScaleNamespace(ns string, replicas int32) error

ScaleNamespace scale deployments and statefullsets.

Types

type DeleteALLResult added in v0.2.7

type DeleteALLResult struct {
	DeleteNamespaceResult         DeleteALLResultOperation
	DeleteGitlabRegistryTagResult DeleteALLResultOperation
	DeleteClusterRolesAndBindings DeleteALLResultOperation
}

func DeleteALL added in v0.2.7

func DeleteALL(ns string, tag string, projectID string) *DeleteALLResult

func (*DeleteALLResult) JSON added in v0.2.7

func (t *DeleteALLResult) JSON() string

type DeleteALLResultOperation added in v0.2.7

type DeleteALLResultOperation struct {
	Result string
}

type ExecContainerResults added in v0.2.7

type ExecContainerResults struct {
	Stdout   string
	Stderr   string
	ExecCode string
}

func ExecContainer added in v0.2.7

func ExecContainer(ns string, pod string, labelSelector string, container string, command string) (*ExecContainerResults, error)

type GetClusterKubeconfigResult added in v0.2.7

type GetClusterKubeconfigResult struct {
	Endpoint    string
	CACrt       string
	CACrtBase64 string
	Token       string
}

func GetClusterKubeconfig added in v0.2.7

func GetClusterKubeconfig(cluster string) (*GetClusterKubeconfigResult, error)

type GetFrontConfigBatch added in v0.3.1

type GetFrontConfigBatch struct {
	ScaleDownHourMinPeriod string
	ScaleDownHourMaxPeriod string
	BatchSheduleTimezone   string
}

type GetFrontConfigItem added in v0.3.1

type GetFrontConfigItem struct {
	ClusterName string
	Links       config.Links
}

type GetFrontConfigResult added in v0.3.1

type GetFrontConfigResult struct {
	Version                   string
	Links                     config.Links
	Batch                     GetFrontConfigBatch
	Clusters                  []GetFrontConfigItem
	ExternalServicesTemplates []config.Template
	DebugTemplates            []config.Template
}

func GetFrontConfig added in v0.3.1

func GetFrontConfig() *GetFrontConfigResult

Get config for front pages.

type GetGitlabPipelinesStatusResults added in v0.3.1

type GetGitlabPipelinesStatusResults struct {
	LastErrorPipeline   string
	LastRunningPipeline string
}

func GetGitlabPipelinesStatus added in v0.3.1

func GetGitlabPipelinesStatus(projectID string, ns string) (*GetGitlabPipelinesStatusResults, error)

type GetGitlabProjectBranchItem added in v0.3.1

type GetGitlabProjectBranchItem struct {
	Name string
	// contains filtered or unexported fields
}

func GetGitlabProjectBranches added in v0.3.1

func GetGitlabProjectBranches(projectID string) ([]*GetGitlabProjectBranchItem, error)

type GetGitlabProjectsInfoItem added in v0.3.1

type GetGitlabProjectsInfoItem struct {
	PodRunning *GetPodByImageResult
	Pipelines  *GetGitlabPipelinesStatusResults
}

func GetGitlabProjectsInfo added in v0.3.1

func GetGitlabProjectsInfo(projectID string, ns string) (*GetGitlabProjectsInfoItem, error)

type GetGitlabProjectsItem added in v0.2.7

type GetGitlabProjectsItem struct {
	ProjectID      int
	Name           string
	Description    string
	DefaultBranch  string
	WebURL         string
	TagsList       []string
	AdditionalInfo string // custom field for front end
	Deploy         bool   // custom field for front end
}

func GetGitlabProjects added in v0.2.7

func GetGitlabProjects() ([]*GetGitlabProjectsItem, error)

type GetIngressList added in v0.2.7

type GetIngressList struct {
	Namespace               string
	Cluster                 string
	NamespaceName           string
	NamespaceStatus         string
	NamespaceCreated        string
	NamespaceCreatedDays    int
	NamespaceLastScaled     string
	NamespaceLastScaledDays int
	NamespaceAnotations     map[string]string
	IngressName             string
	IngressAnotations       map[string]string
	IngressLabels           map[string]string
	Hosts                   []string
	GitBranch               string
	RunningPodsCount        int
}

func GetIngress added in v0.2.7

func GetIngress() ([]*GetIngressList, error)

GetIngress list all kubernetes-manager ingresses.

type GetPodByImageResult added in v0.3.1

type GetPodByImageResult struct {
	Tag   string
	Found bool
}

func GetPodByImage added in v0.3.1

func GetPodByImage(ns string, imagePrefix string) (*GetPodByImageResult, error)

type GetPodsItem added in v0.2.7

type GetPodsItem struct {
	PodName       string
	PodLabels     map[string]string
	PodContainers []GetPodsItemContainers
}

func GetPods added in v0.2.7

func GetPods(ns string) ([]*GetPodsItem, error)

type GetPodsItemContainers added in v0.2.7

type GetPodsItemContainers struct {
	ContainerName string
}

type GetServicesItem added in v0.2.7

type GetServicesItem struct {
	Name         string
	ServiceHost  string
	ExternalName string
	Ports        string
	Labels       string
}

func GetServices added in v0.2.7

func GetServices(ns string) ([]*GetServicesItem, error)

Return services and pods with port.

Jump to

Keyboard shortcuts

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