mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: bump github.com/ceph/go-ceph from 0.11.0 to 0.12.0
Bumps [github.com/ceph/go-ceph](https://github.com/ceph/go-ceph) from 0.11.0 to 0.12.0. - [Release notes](https://github.com/ceph/go-ceph/releases) - [Changelog](https://github.com/ceph/go-ceph/blob/master/docs/release-process.md) - [Commits](https://github.com/ceph/go-ceph/compare/v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: github.com/ceph/go-ceph dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
fedbb01ec3
commit
a66012a5d4
1
vendor/github.com/ceph/go-ceph/rbd/admin/admin.go
generated
vendored
1
vendor/github.com/ceph/go-ceph/rbd/admin/admin.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build !nautilus
|
||||
// +build !nautilus
|
||||
|
||||
package admin
|
||||
|
46
vendor/github.com/ceph/go-ceph/rbd/admin/imagespec.go
generated
vendored
Normal file
46
vendor/github.com/ceph/go-ceph/rbd/admin/imagespec.go
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
//go:build !nautilus && ceph_preview
|
||||
// +build !nautilus,ceph_preview
|
||||
|
||||
package admin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ImageSpec values are used to identify an RBD image wherever Ceph APIs
|
||||
// require an image_spec/image_id_spec using image name/id and optional
|
||||
// pool and namespace.
|
||||
// PREVIEW
|
||||
type ImageSpec struct {
|
||||
spec string
|
||||
}
|
||||
|
||||
// NewImageSpec is used to construct an ImageSpec given an image name/id
|
||||
// and optional namespace and pool names.
|
||||
// PREVIEW
|
||||
//
|
||||
// NewImageSpec constructs an ImageSpec to identify an RBD image and thus
|
||||
// requires image name/id, whereas NewLevelSpec constructs LevelSpec to
|
||||
// identify entire pool, pool namespace or single RBD image, all of which
|
||||
// requires pool name.
|
||||
func NewImageSpec(pool, namespace, image string) ImageSpec {
|
||||
var s string
|
||||
if pool != "" && namespace != "" {
|
||||
s = fmt.Sprintf("%s/%s/%s", pool, namespace, image)
|
||||
} else if pool != "" {
|
||||
s = fmt.Sprintf("%s/%s", pool, image)
|
||||
} else {
|
||||
s = image
|
||||
}
|
||||
return ImageSpec{s}
|
||||
}
|
||||
|
||||
// NewRawImageSpec returns a ImageSpec directly based on the spec string
|
||||
// argument without constructing it from component values.
|
||||
// PREVIEW
|
||||
//
|
||||
// This should only be used if NewImageSpec can not create the imagespec value
|
||||
// you want to pass to ceph.
|
||||
func NewRawImageSpec(spec string) ImageSpec {
|
||||
return ImageSpec{spec}
|
||||
}
|
1
vendor/github.com/ceph/go-ceph/rbd/admin/msschedule.go
generated
vendored
1
vendor/github.com/ceph/go-ceph/rbd/admin/msschedule.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build !nautilus
|
||||
// +build !nautilus
|
||||
|
||||
package admin
|
||||
|
143
vendor/github.com/ceph/go-ceph/rbd/admin/task.go
generated
vendored
Normal file
143
vendor/github.com/ceph/go-ceph/rbd/admin/task.go
generated
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
//go:build !nautilus && ceph_preview
|
||||
// +build !nautilus,ceph_preview
|
||||
|
||||
package admin
|
||||
|
||||
import (
|
||||
ccom "github.com/ceph/go-ceph/common/commands"
|
||||
"github.com/ceph/go-ceph/internal/commands"
|
||||
)
|
||||
|
||||
// TaskAdmin encapsulates management functions for ceph rbd task operations.
|
||||
// PREVIEW
|
||||
type TaskAdmin struct {
|
||||
conn ccom.MgrCommander
|
||||
}
|
||||
|
||||
// Task returns a TaskAdmin type for managing ceph rbd task operations.
|
||||
// PREVIEW
|
||||
func (ra *RBDAdmin) Task() *TaskAdmin {
|
||||
return &TaskAdmin{conn: ra.conn}
|
||||
}
|
||||
|
||||
// TaskRefs contains the action name and information about the image.
|
||||
// PREVIEW
|
||||
type TaskRefs struct {
|
||||
Action string `json:"action"`
|
||||
PoolName string `json:"pool_name"`
|
||||
PoolNamespace string `json:"pool_namespace"`
|
||||
ImageName string `json:"image_name"`
|
||||
ImageID string `json:"image_id"`
|
||||
}
|
||||
|
||||
// TaskResponse contains the information about the task added on an image.
|
||||
// PREVIEW
|
||||
type TaskResponse struct {
|
||||
Sequence int `json:"sequence"`
|
||||
ID string `json:"id"`
|
||||
Message string `json:"message"`
|
||||
Refs TaskRefs `json:"refs"`
|
||||
InProgress bool `json:"in_progress"`
|
||||
Progress float64 `json:"progress"`
|
||||
RetryAttempts int `json:"retry_attempts"`
|
||||
RetryTime string `json:"retry_time"`
|
||||
RetryMessage string `json:"retry_message"`
|
||||
}
|
||||
|
||||
func parseTaskResponse(res commands.Response) (TaskResponse, error) {
|
||||
var taskResponse TaskResponse
|
||||
err := res.NoStatus().Unmarshal(&taskResponse).End()
|
||||
return taskResponse, err
|
||||
}
|
||||
|
||||
func parseTaskResponseList(res commands.Response) ([]TaskResponse, error) {
|
||||
var taskResponseList []TaskResponse
|
||||
err := res.NoStatus().Unmarshal(&taskResponseList).End()
|
||||
return taskResponseList, err
|
||||
}
|
||||
|
||||
// AddFlatten adds a background task to flatten a cloned image based on the
|
||||
// supplied image spec.
|
||||
// PREVIEW
|
||||
//
|
||||
// Similar To:
|
||||
// rbd task add flatten <image_spec>
|
||||
func (ta *TaskAdmin) AddFlatten(img ImageSpec) (TaskResponse, error) {
|
||||
m := map[string]string{
|
||||
"prefix": "rbd task add flatten",
|
||||
"image_spec": img.spec,
|
||||
"format": "json",
|
||||
}
|
||||
return parseTaskResponse(commands.MarshalMgrCommand(ta.conn, m))
|
||||
}
|
||||
|
||||
// AddRemove adds a background task to remove an image based on the supplied
|
||||
// image spec.
|
||||
// PREVIEW
|
||||
//
|
||||
// Similar To:
|
||||
// rbd task add remove <image_spec>
|
||||
func (ta *TaskAdmin) AddRemove(img ImageSpec) (TaskResponse, error) {
|
||||
m := map[string]string{
|
||||
"prefix": "rbd task add remove",
|
||||
"image_spec": img.spec,
|
||||
"format": "json",
|
||||
}
|
||||
return parseTaskResponse(commands.MarshalMgrCommand(ta.conn, m))
|
||||
}
|
||||
|
||||
// AddTrashRemove adds a background task to remove an image from the trash based
|
||||
// on the supplied image id spec.
|
||||
// PREVIEW
|
||||
//
|
||||
// Similar To:
|
||||
// rbd task add trash remove <image_id_spec>
|
||||
func (ta *TaskAdmin) AddTrashRemove(img ImageSpec) (TaskResponse, error) {
|
||||
m := map[string]string{
|
||||
"prefix": "rbd task add trash remove",
|
||||
"image_id_spec": img.spec,
|
||||
"format": "json",
|
||||
}
|
||||
return parseTaskResponse(commands.MarshalMgrCommand(ta.conn, m))
|
||||
}
|
||||
|
||||
// List pending or running asynchronous tasks.
|
||||
// PREVIEW
|
||||
//
|
||||
// Similar To:
|
||||
// rbd task list
|
||||
func (ta *TaskAdmin) List() ([]TaskResponse, error) {
|
||||
m := map[string]string{
|
||||
"prefix": "rbd task list",
|
||||
"format": "json",
|
||||
}
|
||||
return parseTaskResponseList(commands.MarshalMgrCommand(ta.conn, m))
|
||||
}
|
||||
|
||||
// GetTaskByID returns pending or running asynchronous task using id.
|
||||
// PREVIEW
|
||||
//
|
||||
// Similar To:
|
||||
// rbd task list <task_id>
|
||||
func (ta *TaskAdmin) GetTaskByID(taskID string) (TaskResponse, error) {
|
||||
m := map[string]string{
|
||||
"prefix": "rbd task list",
|
||||
"task_id": taskID,
|
||||
"format": "json",
|
||||
}
|
||||
return parseTaskResponse(commands.MarshalMgrCommand(ta.conn, m))
|
||||
}
|
||||
|
||||
// Cancel a pending or running asynchronous task.
|
||||
// PREVIEW
|
||||
//
|
||||
// Similar To:
|
||||
// rbd task cancel <task_id>
|
||||
func (ta *TaskAdmin) Cancel(taskID string) (TaskResponse, error) {
|
||||
m := map[string]string{
|
||||
"prefix": "rbd task cancel",
|
||||
"task_id": taskID,
|
||||
"format": "json",
|
||||
}
|
||||
return parseTaskResponse(commands.MarshalMgrCommand(ta.conn, m))
|
||||
}
|
Reference in New Issue
Block a user