v11

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.

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 CreatePolicy

func CreatePolicy(ctx context.Context, client api.Client, name string, sourcePath string, targetPath string, targetHost string, targetCert string, rpo int, enabled bool) error

func DeletePolicy

func DeletePolicy(ctx context.Context, client api.Client, name string) error

func DeleteTargetPolicy

func DeleteTargetPolicy(ctx context.Context, client api.Client, id string) error

func ResetPolicy

func ResetPolicy(ctx context.Context, client api.Client, name string) error

func ResolvePolicy added in v1.11.1

func ResolvePolicy(ctx context.Context, client api.Client, policy *ResolvePolicyReq) error

func UpdatePolicy

func UpdatePolicy(ctx context.Context, client api.Client, policy *Policy) error

Types

type FAILOVER_FAILBACK_STATE

type FAILOVER_FAILBACK_STATE string
const (
	WRITES_DISABLED        FAILOVER_FAILBACK_STATE = "writes_disabled"
	ENABLING_WRITES        FAILOVER_FAILBACK_STATE = "enabling_writes"
	WRITES_ENABLED         FAILOVER_FAILBACK_STATE = "writes_enabled"
	DISABLING_WRITES       FAILOVER_FAILBACK_STATE = "disabling_writes"
	CREATING_RESYNC_POLICY FAILOVER_FAILBACK_STATE = "creating_resync_policy"
	RESYNC_POLICY_CREATED  FAILOVER_FAILBACK_STATE = "resync_policy_created"
)

type JOB_ACTION

type JOB_ACTION string
const (
	RESYNC_PREP        JOB_ACTION = "resync_prep"
	ALLOW_WRITE        JOB_ACTION = "allow_write"
	ALLOW_WRITE_REVERT JOB_ACTION = "allow_write_revert"
	TEST               JOB_ACTION = "test"
)

type JOB_STATE

type JOB_STATE string
const (
	SCHEDULED       JOB_STATE = "scheduled"
	RUNNING         JOB_STATE = "running"
	PAUSED          JOB_STATE = "paused"
	FINISHED        JOB_STATE = "finished"
	FAILED          JOB_STATE = "failed"
	CANCELED        JOB_STATE = "canceled"
	NEEDS_ATTENTION JOB_STATE = "needs_attention"
	SKIPPED         JOB_STATE = "skipped"
	PENDING         JOB_STATE = "pending"
	UNKNOWN         JOB_STATE = "unknown"
)

type Job

type Job struct {
	Action RUNNING_JOB_ACTION `json:"policy_action,omitempty"`
	Id     string             `json:"id,omitempty"` // ID or Name of policy
}

func GetJobsByPolicyName

func GetJobsByPolicyName(ctx context.Context, client api.Client, policyName string) ([]Job, error)

func StartSyncIQJob

func StartSyncIQJob(ctx context.Context, client api.Client, job *JobRequest) (*Job, error)

type JobRequest

type JobRequest struct {
	Action       JOB_ACTION `json:"action,omitempty"`
	Id           string     `json:"id,omitempty"` // ID or Name of policy
	SkipFailover bool       `json:"skip_failover,omitempty"`
	SkipMap      bool       `json:"skip_map,omitempty"`
	SkipCopy     bool       `json:"skip_copy,omitempty"`
}

type Jobs

type Jobs struct {
	Job []Job `json:"jobs,omitempty"`
}

type Policies

type Policies struct {
	Policy []Policy `json:"policies,omitempty"`
}

type Policy

type Policy struct {
	Action       string    `json:"action,omitempty"`
	Id           string    `json:"id,omitempty"`
	Name         string    `json:"name,omitempty"`
	Enabled      bool      `json:"enabled"`
	TargetPath   string    `json:"target_path,omitempty"`
	SourcePath   string    `json:"source_root_path,omitempty"`
	TargetHost   string    `json:"target_host,omitempty"`
	TargetCert   string    `json:"target_certificate_id,omitempty"`
	JobDelay     int       `json:"job_delay,omitempty"`
	Schedule     string    `json:"schedule"`
	LastJobState JOB_STATE `json:"last_job_state,omitempty"`
}

Policy contains the CloudIQ policy info.

func GetPolicyByName

func GetPolicyByName(ctx context.Context, client api.Client, name string) (policy *Policy, err error)

GetPolicyByName returns policy by name

type RUNNING_JOB_ACTION

type RUNNING_JOB_ACTION string
const (
	SYNC RUNNING_JOB_ACTION = "sync"
	COPY RUNNING_JOB_ACTION = "copy"
)

type Report

type Report struct {
	Policy  Policy    `json:"policy,omitempty"`
	Id      string    `json:"id"`
	JobId   int64     `json:"job_id"`
	State   JOB_STATE `json:"state,omitempty"`
	EndTime int64     `json:"end_time"`
	Errors  []string  `json:"errors"`
}

func GetReport

func GetReport(ctx context.Context, client api.Client, reportName string) (*Report, error)

type Reports

type Reports struct {
	Reports []Report `json:"reports,omitempty"`
}

func GetReportsByPolicyName

func GetReportsByPolicyName(ctx context.Context, client api.Client, policyName string, reportsForPolicy int) (*Reports, error)

type ResolvePolicyReq added in v1.11.1

type ResolvePolicyReq struct {
	Id         string `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	Enabled    bool   `json:"enabled"`
	Conflicted bool   `json:"conflicted"`
	Schedule   string `json:"schedule"`
}

type TargetPolicies

type TargetPolicies struct {
	Policy []TargetPolicy `json:"policies,omitempty"`
}

type TargetPolicy

type TargetPolicy struct {
	Id                      string                  `json:"id,omitempty"`
	Name                    string                  `json:"name,omitempty"`
	SourceClusterGuid       string                  `json:"source_cluster_guid,omitempty"`
	LastJobState            JOB_STATE               `json:"last_job_state,omitempty"`
	TargetPath              string                  `json:"target_path,omitempty"`
	SourceHost              string                  `json:"source_host,omitempty"`
	LastSourceCoordinatorIp string                  `json:"last_source_coordinator_ip,omitempty"`
	FailoverFailbackState   FAILOVER_FAILBACK_STATE `json:"failover_failback_state,omitempty"`
}

func GetTargetPolicyByName

func GetTargetPolicyByName(ctx context.Context, client api.Client, name string) (policy *TargetPolicy, err error)

Jump to

Keyboard shortcuts

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