Class: OracleZFS::ReplicationServices

Inherits:
Object
  • Object
show all
Includes:
MintLogger
Defined in:
src/oracle-zfs-client/lib/oracle-zfs/replication.rb

Properties (Read/Write)

Properties (Read Only)

Constant Summary

Constants included from MintLogger

MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN

Instance Method Summary collapse

Methods included from MintLogger::Utils::Common

#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send

Constructor Details

#initialize(client) ⇒ ReplicationServices

Returns a new instance of ReplicationServices.

Instance Method Details

#filesystem_exists?(pool:, project:, filesystem:) ⇒ Boolean

Returns:

  • (Boolean)

#filesystem_replication_actions_status(pool:, project:, filesystem:) ⇒ Object

#replication_action_cancelupdate(replication_target:, source_pool:, source_project:, source_filesystem: nil) ⇒ Object

#replication_action_create(replication_target:, source_pool:, source_project:, source_filesystem: nil, target_pool:, enabled: true, continuous: false, include_snaps: true, max_bandwidth: "unlimited", use_ssl: true, compression: true, include_clone_origin_as_data: nil, retain_user_snaps_on_target: nil) ⇒ Object

#replication_action_delete(replication_target:, source_pool:, source_project:, source_filesystem: nil) ⇒ Object

## REST API is BROKEN!!!! Payload format to be sent to API is unknown and not documented. def replication_action_schedule_create(replication_target:, source_pool:, source_project:, source_filesystem: nil, frequency:, day: nil, hour: nil, minute: nil) raise "Please ensure you set either the day, hour, or minute parameter on the schedule." if day.nil? and hour.nil? and minute.nil? if ! replication_action_schedule_exists?(replication_target: replication_target, source_pool: source_pool, source_project: source_project, source_filesystem: source_filesystem, frequency: frequency, day: day, hour: hour, minute: minute) puts "Creating New Replication Action Schedule ..." ra_id = replication_action_id(replication_target: replication_target, source_pool: source_pool, source_project: source_project, source_filesystem: source_filesystem) puts "Found Replication Action ID: " + ra_id.inspect raise "Could not find Replication Action ID. Aborting." if ra_id.nil? day = "" if day.nil? hour = "" if hour.nil? minute = "" if minute.nil? # if ! source_filesystem.nil? # if ! filesystem_exists?(pool: source_pool, project: source_project, filesystem: source_filesystem) # raise "Filesystem [ #source_filesystem ] does not exist in Pool [ #source_pool ] with Project [ #source_project ]" # end # else # puts "INFO: Replication action schedule will be created at the project level." # end # payload = { "schedules" => [ { "frequency" => frequency, "day" => day, "hour" => hour, "minute" => minute } ] } payload = { "frequency" => frequency, "day" => day, "hour" => hour, "minute" => minute } response = @client.http_post('/api/storage/v1/replication/actions/' + ra_id + '/schedules', payload.to_json) return response else puts "Replication Action Schedule already exists. No action." end end

#replication_action_exists?(replication_target:, source_pool:, source_project:, source_filesystem: nil) ⇒ Boolean

Returns:

  • (Boolean)

#replication_action_get(action_id) ⇒ Object

#replication_action_id(replication_target:, source_pool:, source_project:, source_filesystem: nil) ⇒ Object

#replication_action_id_exists?(action_id) ⇒ Boolean

Replication Actions

Returns:

  • (Boolean)

#replication_action_modify(replication_target:, source_pool:, source_project:, source_filesystem: nil, target_pool:, enabled: true, continuous: false, include_snaps: true, max_bandwidth: "unlimited", use_ssl: true, compression: true, export_path: nil, include_clone_origin_as_data: nil, retain_user_snaps_on_target: nil) ⇒ Object

#replication_action_schedule_exists?(replication_target:, source_pool:, source_project:, source_filesystem: nil, frequency:, day: nil, hour: nil, minute: nil) ⇒ Boolean

Returns:

  • (Boolean)

#replication_action_schedules(replication_target:, source_pool:, source_project:, source_filesystem: nil) ⇒ Object

#replication_action_sendupdate(replication_target:, source_pool:, source_project:, source_filesystem: nil) ⇒ Object

#replication_actionsObject

#replication_disableObject

#replication_enableObject

#replication_enabled?Boolean

Returns:

  • (Boolean)

#replication_package_exists?(source:, package:) ⇒ Boolean

Returns:

  • (Boolean)

#replication_package_get(source:, package:) ⇒ Object

#replication_packages(source:) ⇒ Object

#replication_source_exists?(source) ⇒ Boolean

Returns:

  • (Boolean)

#replication_source_get(source) ⇒ Object

#replication_sourcesObject

Replication Source and Packages

#replication_stateObject

Replication

#replication_target_create(name:, hostname:, password:) ⇒ Object

#replication_target_delete(name:) ⇒ Object

#replication_target_exists?(target) ⇒ Boolean

Replication Targets

Returns:

  • (Boolean)

#replication_target_get(target) ⇒ Object

#replication_targetsObject