Portworx OpenStorageFilesystemDefrag API
The OpenStorageFilesystemDefrag API from Portworx — 4 operation(s) for openstoragefilesystemdefrag.
The OpenStorageFilesystemDefrag API from Portworx — 4 operation(s) for openstoragefilesystemdefrag.
openapi: 3.0.0
info:
title: OpenStorage SDK OpenStorageAlerts OpenStorageFilesystemDefrag API
version: 0.186.0
security:
- bearerAuth: []
tags:
- name: OpenStorageFilesystemDefrag
paths:
/v1/filesystem-defrag/schedule:
post:
operationId: OpenStorageFilesystemDefrag_CreateSchedule
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/apiSdkCreateDefragScheduleRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/apiSdkCreateDefragScheduleResponse'
description: A successful response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/runtimeError'
description: An unexpected error response.
summary: Create a schedule to run defragmentation tasks periodically
tags:
- OpenStorageFilesystemDefrag
/v1/filesystem-defrag/schedules:
delete:
operationId: OpenStorageFilesystemDefrag_CleanUpSchedules
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/apiSdkCleanUpDefragSchedulesResponse'
description: A successful response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/runtimeError'
description: An unexpected error response.
summary: Clean up all defrag schedules and stop all operations
tags:
- OpenStorageFilesystemDefrag
/v1/filesystem-defrag/status:
get:
operationId: OpenStorageFilesystemDefrag_EnumerateNodeStatus
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/apiSdkEnumerateDefragStatusResponse'
description: A successful response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/runtimeError'
description: An unexpected error response.
summary: Enumerate all nodes, returning defrag status of the entire cluster
tags:
- OpenStorageFilesystemDefrag
/v1/filesystem-defrag/status/{node_id}:
get:
operationId: OpenStorageFilesystemDefrag_GetNodeStatus
parameters:
- description: NodeId is uuid of the node
in: path
name: node_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/apiSdkGetDefragNodeStatusResponse'
description: A successful response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/runtimeError'
description: An unexpected error response.
summary: Get defrag status of a node
tags:
- OpenStorageFilesystemDefrag
components:
schemas:
apiSdkDiagsCollectRequest:
properties:
filename:
description: Filename is an optional flag only to be used for testing purposes.
type: string
issuer:
title: Issuer is an optional user friendly name for the caller invoking the API
type: string
live:
title: Live is an optional flag if true will collect live cores from running processes of the driver
type: boolean
node:
$ref: '#/components/schemas/apiDiagsNodeSelector'
profile_only:
title: 'ProfileOnly is an optional flag if true will only collect the stack and heap profile of the driver and will skip
other diag components'
type: boolean
timeout_mins:
format: int64
title: 'TimeoutMins is the timeout in minutes for the job. This is an optional field and if not provided, the
implementation of the SDK will use a sane default'
type: string
volume:
$ref: '#/components/schemas/apiDiagsVolumeSelector'
title: 'SdkDiagsCollectRequest is the request object that specifies what should be part of the diags that are collected
User can specify both Node and Volume or just one of them. If both are provided, the implementation will select
nodes based on both and also handle overlaps'
type: object
apiSchedule:
properties:
create_time:
format: date-time
title: CreateTime is the time the schedule was created
type: string
id:
title: ID of the schedule
type: string
last_update_time:
format: date-time
title: LastUpdateTime is the time the schedule was updated
type: string
max_duration_minutes:
format: int64
title: MaxDurationMinutes defines the time limit of one run in minutes
type: integer
start_time:
title: "StartTime is the scheduled time to start a run\nValid formats: \n daily=HH:mm e.g. daily=19:15\n weekly=weekday@HH:mm e.g. weekly=Sunday@19:15\n monthly=dd@HH:mm e.g. monthly=22@19:15"
type: string
tasks:
items:
$ref: '#/components/schemas/apiJob'
title: Tasks is the tasks to be run in this schedule (must be of same job type)
type: array
type:
$ref: '#/components/schemas/apiJobType'
title: "Schedule is a generic schedule object that can encapsulate different \ntypes of scheduled jobs which follow the schedule framework of APIs"
type: object
apiSdkCreateDefragScheduleResponse:
properties:
schedule:
$ref: '#/components/schemas/apiSchedule'
title: Defines a response of defrag schedule creation
type: object
apiSdkCleanUpDefragSchedulesResponse:
title: Defines a response of defrag schedules clean-up
type: object
apiSdkNodeDrainAttachmentsRequest:
properties:
issuer:
title: 'Issuer is a user friendly name for the caller who is
invoking the API. It can be used by caller to filter out
drain requests from a particular issuer'
type: string
node_id:
title: Id of the node to drain
type: string
only_sharedv4:
description: 'Drain only sharedv4 volumes from a node
By default all volumes will be drained.'
type: boolean
selector:
description: 'Selector is used for selecting volumes whose
attachment needs to be moved from this node.
The selector could be a list of volume label
key value pairs to select a subset of volumes.'
items:
$ref: '#/components/schemas/apiLabelSelectorRequirement'
type: array
title: Defines a node drain volume attachments request
type: object
apiDefragNodeStatus:
properties:
last_update_time:
format: date-time
title: LastUpdateTime is the time when DefragNodeStatus or any DefragPoolStatus was last updated on this node
type: string
pool_status:
additionalProperties:
$ref: '#/components/schemas/apiDefragPoolStatus'
title: PoolStatus is a map of <pool_uuid, DefragPoolStatus> pairs
type: object
running_schedule:
title: RunningSchedule is the defrag schedule being run on the node
type: string
title: DefragNodeStatus describes the defragmentation status of a node
type: object
apiCloudDriveTransferJob:
properties:
destination_instance_id:
title: DestinationInstanceID is the ID of the storageless instance that needs to take over the SourceDriveSetID
type: string
source_driveset_id:
title: SourceDrivesetID is the ID of the current driveset that needs to be transferred
type: string
status:
title: Status describes a helpful status of this operation
type: string
type: object
apiDiagsCollectionStatus:
properties:
message:
title: Message is a user friendly message for current status of diags collection
type: string
node:
title: Node is the node that's collecting the diags
type: string
state:
$ref: '#/components/schemas/apiDiagsCollectionStatusState'
type: object
apiDiagsVolumeSelector:
properties:
volume_ids:
items:
type: string
title: 'VolumeIDs selects volumes by their unique IDs and then uses replica and attached nodes for those volumes for diags
collection'
type: array
volume_label_selector:
items:
$ref: '#/components/schemas/apiLabelSelectorRequirement'
title: 'VolumeLabelSelector selects volumes by their labels and then uses replica and attached nodes for those volumes for
diags collection'
type: array
title: 'DiagsVolumeSelector allows selecting volumes for diags collection
User can select VolumeLabelSelector AND/OR VolumeIDs. If both are provided, the implementation will select nodes
based on both labels and IDs and also handle overlaps'
type: object
apiLabelSelectorRequirement:
description: 'LabelSelectorRequirement is a selector that contains values, a key, and an operator that
relates the key and values.'
properties:
key:
description: Key is the label key that the selector applies to.
type: string
operator:
$ref: '#/components/schemas/LabelSelectorRequirementOperator'
values:
description: 'Values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.'
items:
type: string
type: array
type: object
apiDefragJob:
properties:
current_running_nodes:
items:
type: string
title: CurrentRunningNodes stores the nodes on which the job is currently running
type: array
exclude_nodes:
items:
type: string
title: 'ExcludeNodes is a list of node UUID: if provided, the job will skip these nodes;
if not provided, will run on all nodes
cannot coexist with IncludeNodes'
type: array
include_nodes:
items:
type: string
title: 'IncludeNodes is a list of node UUID: if provided, will only run the job on these nodes;
if not provided, will run on all nodes
cannot coexist with ExcludeNodes and NodeSelector'
type: array
max_duration_minutes:
format: int64
title: MaxDurationMinutes defines the time limit in minutes
type: integer
max_nodes_in_parallel:
format: int64
title: MaxNodesInParallel defines the maximum number of nodes running the defrag job in parallel
type: integer
node_selector:
items:
$ref: '#/components/schemas/apiLabelSelectorRequirement'
title: 'NodeSelector is a list of node label `key=value` pairs,
which selects the nodes to be run on for the job
can coexist with ExcludeNodes but cannot coexist with IncludeNodes'
type: array
schedule_id:
title: ScheduleId is the ID of the schedule which started this job
type: string
schedule_one_iteration_only:
title: ScheduleOneIterationOnly is true when the defragJob is run by a one-iteration-only schedule
type: boolean
title: DefragJob describes a job to run defragmentation on cluster nodes
type: object
apiCollectDiagsJob:
properties:
request:
$ref: '#/components/schemas/apiSdkDiagsCollectRequest'
statuses:
items:
$ref: '#/components/schemas/apiDiagsCollectionStatus'
title: Statuses is a list of statuses for diags collection for each node that is part of the request
type: array
type: object
apiNodeDrainAttachmentsJob:
properties:
Status:
title: Status describes a helpful status of this node drain operation
type: string
create_time:
format: date-time
title: CreateTime is the time the job was created
type: string
issuer:
title: 'Issuer is a user friendly name for the caller who is
invoking the API. It can be used by caller to filter out
drain requests from a particular issuer'
type: string
last_update_time:
format: date-time
title: LastUpdateTime is the time the job was updated
type: string
node_id:
title: NodeID of the node for which this drain job is running
type: string
parameters:
$ref: '#/components/schemas/apiSdkNodeDrainAttachmentsRequest'
title: NodeDrainAttachmentsJob describe a job to drain volume attachments from a node
type: object
runtimeError:
properties:
code:
format: int32
type: integer
details:
items:
$ref: '#/components/schemas/protobufAny'
type: array
error:
type: string
message:
type: string
type: object
apiDiagsCollectionStatusState:
default: UNSPECIFIED
description: "- UNSPECIFIED: Unspecified means uninitialized or unknown state\n - PENDING: Pending indicates the diags collection is pending and hasn't started\n - RUNNING: Running indicates diags collection is actively running\n - DONE: Done indicates diags collection has finished\n - FAILED: Failed indicates diags collection has failed"
enum:
- UNSPECIFIED
- PENDING
- RUNNING
- DONE
- FAILED
title: State is an enum for state of diags collection on a given node
type: string
apiJob:
properties:
clouddrive_transfer:
$ref: '#/components/schemas/apiCloudDriveTransferJob'
collect_diags:
$ref: '#/components/schemas/apiCollectDiagsJob'
create_time:
format: date-time
title: CreateTime is the time the job was created
type: string
defrag:
$ref: '#/components/schemas/apiDefragJob'
drain_attachments:
$ref: '#/components/schemas/apiNodeDrainAttachmentsJob'
id:
title: ID of the job
type: string
last_update_time:
format: date-time
title: LastUpdateTime is the time the job was updated
type: string
state:
$ref: '#/components/schemas/apiJobState'
type:
$ref: '#/components/schemas/apiJobType'
title: 'Job is a generic job object that can encapsulate other
messages which follow the job framework of APIs'
type: object
LabelSelectorRequirementOperator:
default: In
description: "- In: In means the value for 'key' should be in one of the given value(s)\n - NotIn: NotIn means the value for 'key' should NOT be in one of the given value(s)\n - Exists: Exists means the 'key' should just exist regardless of the value\n - DoesNotExist: DoesNotExist means the 'key' should NOT exist\n - Gt: Gt means the 'key' should be greater than the value(s)\n - Lt: Lt means the 'key' should be less than the value(s)"
enum:
- In
- NotIn
- Exists
- DoesNotExist
- Gt
- Lt
title: This defines operator types used in a label matching rule
type: string
apiDiagsNodeSelector:
properties:
all:
title: All selects all nodes for diags collection
type: boolean
node_ids:
items:
type: string
title: NodeIDs are unique IDs fo the nodes for which the diags will be collected
type: array
node_label_selector:
items:
$ref: '#/components/schemas/apiLabelSelectorRequirement'
title: NodeLabelSelector is a label selector used to select the nodes for which diags will be collected
type: array
title: 'DiagsNodeSelector allows selecting nodes for diags collection
User can select NodeLabelSelector AND/OR NodeIDs. If both are provided, the implementation will select nodes based on
both labels and IDs and also handle overlaps
If All is set to true, other selectors are ignored since it selects all nodes'
type: object
apiSdkEnumerateDefragStatusResponse:
properties:
status:
additionalProperties:
$ref: '#/components/schemas/apiSdkGetDefragNodeStatusResponse'
title: Status is a map with node uuid as the key and defrag node status as the value
type: object
title: Defines a response of defrag status of the entire cluster
type: object
apiDefragPoolStatus:
properties:
last_complete_time:
format: date-time
title: LastCompleteTime is the completion time of the last run on this pool
type: string
last_offset:
format: int64
title: 'LastOffset is the offset of the last defrag command executed on the pending volume
-1 means no volume is in a pending state (either not started or fully finished)'
type: string
last_start_time:
format: date-time
title: LastStartTime is the start time of the latest run (current or last run) on this pool
type: string
last_success:
title: LastSuccess indicates whether the last run of defrag on this pool was successful
type: boolean
last_volume_id:
title: 'LastVolumeId is the volume on which defrag has started but not yet finished
if provided, volume is currently being defraged or was interrupted in the last run of defrag'
type: string
num_iterations:
format: int64
title: NumIterations counts the number of times the pool gets defraged
type: integer
progress_percentage:
format: int64
title: 'ProgressPercentage describes the progress of the lastest defrag job (current or last run) on this pool
percentage = bytes completed / sum of file sizes'
type: integer
running:
title: Running indicates whether the pool is being defraged
type: boolean
title: DefragNodeStatus describes the defragmentation status of a pool
type: object
protobufAny:
properties:
type_url:
type: string
value:
format: byte
type: string
type: object
apiJobState:
default: UNSPECIFIED_STATE
description: "- UNSPECIFIED_STATE: Unspecified\n - PENDING: Pending indicates job is still pending and has not started work\n - RUNNING: Running indicates job is actively running\n - DONE: Done indicates job has finished processing\n - PAUSED: Paused indicates job is paused\n - CANCELLED: Cancelled indicates job is cancelled\n - FAILED: Failed indicates job has failed"
enum:
- UNSPECIFIED_STATE
- PENDING
- RUNNING
- DONE
- PAUSED
- CANCELLED
- FAILED
title: State is an enum for state of a node drain operation
type: string
apiSdkCreateDefragScheduleRequest:
properties:
defrag_task:
$ref: '#/components/schemas/apiDefragJob'
start_time:
title: "StartTime is the scheduled time to start a run\nValid formats: \ndaily=HH:mm e.g. daily=19:15\nweekly=weekday@HH:mm e.g. weekly=Sunday@19:15\nmonthly=dd@HH:mm e.g. monthly=22@19:15"
type: string
title: Defines a request to create a defrag schedule
type: object
apiJobType:
default: UNSPECIFIED_TYPE
description: "- UNSPECIFIED_TYPE: Unspecified\n - NONE: None\n - DRAIN_ATTACHMENTS: Job for draining volume attachments\n - CLOUD_DRIVE_TRANSFER: Job for transferring cloud drives between nodes\n - COLLECT_DIAGS: Job for collecting diags from the cluster nodes\n - DEFRAG: Job for storage defragmentation on cluster nodes"
enum:
- UNSPECIFIED_TYPE
- NONE
- DRAIN_ATTACHMENTS
- CLOUD_DRIVE_TRANSFER
- COLLECT_DIAGS
- DEFRAG
title: Type are the supported job types
type: string
apiSdkGetDefragNodeStatusResponse:
properties:
data_ip:
title: DataIp is the IP address of this node
type: string
defrag_node_status:
$ref: '#/components/schemas/apiDefragNodeStatus'
pool_usage:
additionalProperties:
format: int64
type: integer
title: PoolUsage is a map with pool UUID as the key and pool usage percentage as the value
type: object
scheduler_node_name:
title: SchedulerNodeName is name of the node in scheduler context
type: string
title: Defines a response of defrag node status
type: object
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT