Class: IControl::Management::Partition

Inherits:
Base
  • Object
show all
Defined in:
lib/icontrol/management/partition.rb,
lib/icontrol/management.rb,
lib/icontrol/base/icontrol_overlay/management/partition.rb

Overview

The Partition interface enables you to manage AuthZ Administrative Partitions, as well as relationship between users, roles, and their associated partitions.

Defined Under Namespace

Classes: AuthZPartition, AuthZPartitionSequence

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IControl::Base

Class Method Details

.find(partition_name) ⇒ Object



3
4
5
6
# File 'lib/icontrol/base/icontrol_overlay/management/partition.rb', line 3

def self.find(partition_name)
  partition = [*get_partition_list].flatten.select { |i| i.partition_name == partition_name }.first
  return self.new(:partition_name => partition.partition_name, :description => partition.description) if partition
end

.get_listObject



17
18
19
# File 'lib/icontrol/base/icontrol_overlay/management/partition.rb', line 17

def self.get_list
  get_partition_list
end

.set_active_partition(options) ⇒ Object



12
13
14
15
# File 'lib/icontrol/base/icontrol_overlay/management/partition.rb', line 12

def self.set_active_partition(options)
  options[:raw_call] = true
  return method_missing(:set_active_partition,options)
end

Instance Method Details

#active_partitionString

Gets the active partition for the current user. The active partition is the administrative partition where all configuration will take place until a new active partition is selected. Each user can only be in one active partition at any given time. By default, if not explicitly set, the active partition for a user will be "Common“.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



57
58
59
# File 'lib/icontrol/management/partition.rb', line 57

def active_partition
  super
end

#create_partitionObject

Creates this AuthZ partition.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



16
17
18
# File 'lib/icontrol/management/partition.rb', line 16

def create_partition
  super
end

#deleteObject



8
9
10
# File 'lib/icontrol/base/icontrol_overlay/management/partition.rb', line 8

def delete
  return self.class.delete_partition(:partition_names => partition_name)
end

#delete_all_partitionsObject

Deletes all AuthZ partition, except for the "Common“ partition.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



26
27
28
# File 'lib/icontrol/management/partition.rb', line 26

def delete_all_partitions
  super
end

#delete_partition(opts) ⇒ Object

Deletes this AuthZ partition. It’s recommended that if a partition to be deleted is also the current active partition, the user should change the active partition to something else first (using set_active_partition). Otherwise, in the event that the partition to be deleted is the current active partition, iControl will automatically default the new active partition to the "Common“ partition.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :partition_names (String)

    The names of the AuthZ partitions to delete.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



42
43
44
45
# File 'lib/icontrol/management/partition.rb', line 42

def delete_partition(opts)
  opts = check_params(opts,[:partition_names])
  super(opts)
end

#partition_listAuthZPartition

Gets a list of all AuthZ partition.

Returns:

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



68
69
70
# File 'lib/icontrol/management/partition.rb', line 68

def partition_list
  super
end

#set_active_partition(opts) ⇒ Object

Sets the active partition for the current user. The active partition is the administrative partition where all configuration will take place until a new active partition is selected. Each user can only be in one active partition at any given time. By default, if not explicitly set, the active partition for a user will be "Common“.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :active_partition (String)

    The active partition to set.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



91
92
93
94
# File 'lib/icontrol/management/partition.rb', line 91

def set_active_partition(opts)
  opts = check_params(opts,[:active_partition])
  super(opts)
end

#versionString

Gets the version information for this interface.

Returns:

  • (String)


76
77
78
# File 'lib/icontrol/management/partition.rb', line 76

def version
  super
end