def enablefeature(ctx,
           # Mandatory main parameter
           feature):
    """You can use EnableFeature to enable cluster features that are disabled by default."""

    

    cli_utils.establish_connection(ctx)
    
    

    ctx.logger.info(""": """"""feature = """ + str(feature)+""";"""+"")
    try:
        _EnableFeatureResult = ctx.element.enable_feature(feature=feature)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_EnableFeatureResult), indent=4))
        return
    else:
        cli_utils.print_result(_EnableFeatureResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
Exemple #2
0
def getnodeinfo(
        ctx,
        # Mandatory main parameter
        nodeid):
    """GetNodeHardwareInfo enables you to return all the hardware information and status for the node specified. This generally includes details about"""
    """manufacturers, vendors, versions, and other associated hardware identification information."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ """nodeid = """ + str(nodeid) + """;""" + "")
    try:
        _GetNodeHardwareInfoResult = ctx.element.get_node_hardware_info(
            node_id=nodeid)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_GetNodeHardwareInfoResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_GetNodeHardwareInfoResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
def deletegroup(
        ctx,
        # Mandatory main parameter
        groupsnapshotid,
        # Mandatory main parameter
        savemembers):
    """DeleteGroupSnapshot enables you to delete a group snapshot. You can use the saveMembers parameter to preserve all the snapshots that were made for the volumes in the group, but the group association is removed."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """groupsnapshotid = """ + str(groupsnapshotid) + ";" +
                    """savemembers = """ + str(savemembers) + """;""" + "")
    try:
        _DeleteGroupSnapshotResult = ctx.element.delete_group_snapshot(
            group_snapshot_id=groupsnapshotid, save_members=savemembers)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_DeleteGroupSnapshotResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_DeleteGroupSnapshotResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #4
0
def getinfo(ctx):
    """The GetHardwareInfo API method enables you to return hardware information and status for a single node. This generally includes details about manufacturers, vendors, versions, drives, and other associated hardware identification information."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _GetHardwareInfoResult = ctx.element.get_hardware_info()
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_GetHardwareInfoResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_GetHardwareInfoResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #5
0
def getconfig(ctx):
    """GetHardwareConfig enables you to display the hardware configuration information for a node."""
    """Note: This method is available only through the per-node API endpoint 5.0 or later."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _GetHardwareConfigResult = ctx.element.get_hardware_config()
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_GetHardwareConfigResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_GetHardwareConfigResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
def completecluster(
        ctx,
        # Mandatory main parameter
        clusterpairingkey):
    """You can use the CompleteClusterPairing method with the encoded key received from the  StartClusterPairing method to complete the cluster pairing process. The CompleteClusterPairing method is the second step in the cluster pairing process. """

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """clusterpairingkey = """ + str(clusterpairingkey) +
                    """;""" + "")
    try:
        _CompleteClusterPairingResult = ctx.element.complete_cluster_pairing(
            cluster_pairing_key=clusterpairingkey)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_CompleteClusterPairingResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_CompleteClusterPairingResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #7
0
def getconfiguration(ctx):
    """The GetLdapConfiguration method enables you to get the currently active LDAP configuration on the cluster."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _GetLdapConfigurationResult = ctx.element.get_ldap_configuration()
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_GetLdapConfigurationResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_GetLdapConfigurationResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #8
0
def listresults(ctx,
           # Optional main parameter
           asyncresulttypes = None):
    """You can use ListAsyncResults to list the results of all currently running and completed asynchronous methods on the system."""
    """Querying asynchronous results with ListAsyncResults does not cause completed asyncHandles to expire; you can use GetAsyncResult"""
    """to query any of the asyncHandles returned by ListAsyncResults."""

    

    cli_utils.establish_connection(ctx)
    

    asyncresulttypes = parser.parse_array(asyncresulttypes)
    

    ctx.logger.info(""": """"""asyncresulttypes = """+str(asyncresulttypes)+""";"""+"")
    try:
        _ListAsyncResultsResult = ctx.element.list_async_results(async_result_types=asyncresulttypes)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_ListAsyncResultsResult), indent=4))
        return
    else:
        cli_utils.print_result(_ListAsyncResultsResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
Exemple #9
0
def getresult(ctx,
           # Mandatory main parameter
           asynchandle,
           # Optional main parameter
           keepresult = None):
    """You can use GetAsyncResult to retrieve the result of asynchronous method calls. Some method calls require some time to run, and"""
    """might not be finished when the system sends the initial response. To obtain the status or result of the method call, use"""
    """GetAsyncResult to poll the asyncHandle value returned by the method."""
    """GetAsyncResult returns the overall status of the operation (in progress, completed, or error) in a standard fashion, but the actual"""
    """data returned for the operation depends on the original method call and the return data is documented with each method."""

    

    cli_utils.establish_connection(ctx)
    
    
    

    ctx.logger.info(""": """"""asynchandle = """ + str(asynchandle)+";" + """keepresult = """+str(keepresult)+""";"""+"")
    try:
        _dict = ctx.element.get_async_result(async_handle=asynchandle, keep_result=keepresult)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_dict), indent=4))
        return
    else:
        cli_utils.print_result(_dict, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
def getfeaturestatus(ctx,
           # Optional main parameter
           feature = None):
    """GetFeatureStatus enables you to retrieve the status of a cluster feature."""

    

    cli_utils.establish_connection(ctx)
    
    

    ctx.logger.info(""": """"""feature = """+str(feature)+""";"""+"")
    try:
        _GetFeatureStatusResult = ctx.element.get_feature_status(feature=feature)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_GetFeatureStatusResult), indent=4))
        return
    else:
        cli_utils.print_result(_GetFeatureStatusResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
def listtasks(ctx,
           # Optional main parameter
           virtualvolumetaskids = None):
    """ListVirtualVolumeTasks returns a list of virtual volume tasks in the system."""

    

    cli_utils.establish_connection(ctx)
    

    virtualvolumetaskids = parser.parse_array(virtualvolumetaskids)
    

    ctx.logger.info(""": """"""virtualvolumetaskids = """+str(virtualvolumetaskids)+""";"""+"")
    try:
        _ListVirtualVolumeTasksResult = ctx.element.list_virtual_volume_tasks(virtual_volume_task_ids=virtualvolumetaskids)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_ListVirtualVolumeTasksResult), indent=4))
        return
    else:
        cli_utils.print_result(_ListVirtualVolumeTasksResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
def listhosts(ctx,
           # Optional main parameter
           virtualvolumehostids = None):
    """ListVirtualVolumeHosts returns a list of all virtual volume hosts known to the cluster. A virtual volume host is a VMware ESX host"""
    """that has initiated a session with the VASA API provider."""

    

    cli_utils.establish_connection(ctx)
    

    virtualvolumehostids = parser.parse_array(virtualvolumehostids)
    

    ctx.logger.info(""": """"""virtualvolumehostids = """+str(virtualvolumehostids)+""";"""+"")
    try:
        _ListVirtualVolumeHostsResult = ctx.element.list_virtual_volume_hosts(virtual_volume_host_ids=virtualvolumehostids)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_ListVirtualVolumeHostsResult), indent=4))
        return
    else:
        cli_utils.print_result(_ListVirtualVolumeHostsResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
def listprotocolendpoints(ctx,
           # Optional main parameter
           protocolendpointids = None):
    """ListProtocolEndpoints enables you to retrieve information about all protocol endpoints in the cluster. Protocol endpoints govern"""
    """access to their associated virtual volume storage containers."""

    

    cli_utils.establish_connection(ctx)
    

    protocolendpointids = parser.parse_array(protocolendpointids)
    

    ctx.logger.info(""": """"""protocolendpointids = """+str(protocolendpointids)+""";"""+"")
    try:
        _ListProtocolEndpointsResult = ctx.element.list_protocol_endpoints(protocol_endpoint_ids=protocolendpointids)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_ListProtocolEndpointsResult), indent=4))
        return
    else:
        cli_utils.print_result(_ListProtocolEndpointsResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
def listvolumestatsby(ctx,
           # Optional main parameter
           virtualvolumeids = None):
    """ListVolumeStatsByVirtualVolume enables you to list volume statistics for any volumes in the system that are associated with virtual volumes. Statistics are cumulative from the creation of the volume."""

    

    cli_utils.establish_connection(ctx)
    

    virtualvolumeids = parser.parse_array(virtualvolumeids)
    

    ctx.logger.info(""": """"""virtualvolumeids = """+str(virtualvolumeids)+""";"""+"")
    try:
        _ListVolumeStatsByVirtualVolumeResult = ctx.element.list_volume_stats_by_virtual_volume(virtual_volume_ids=virtualvolumeids)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_ListVolumeStatsByVirtualVolumeResult), indent=4))
        return
    else:
        cli_utils.print_result(_ListVolumeStatsByVirtualVolumeResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
Exemple #15
0
def startcluster(ctx):
    """You can use the StartClusterPairing method to create an encoded key from a cluster that is used to pair with another cluster. The key created from this API method is used in the CompleteClusterPairing API method to establish a cluster pairing. You can pair a cluster with a maximum of four other clusters. """

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _StartClusterPairingResult = ctx.element.start_cluster_pairing()
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_StartClusterPairingResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_StartClusterPairingResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #16
0
def shutdown(
        ctx,
        # Mandatory main parameter
        nodes,
        # Optional main parameter
        option=None):
    """The Shutdown API method enables you to restart or shutdown a node that has not yet been added to a cluster. To use this method,"""
    """log in to the MIP for the pending node, and enter the "shutdown" method with either the "restart" or "halt" options."""

    cli_utils.establish_connection(ctx)

    nodes = parser.parse_array(nodes)

    ctx.logger.info(""": """
                    """nodes = """ + str(nodes) + ";" + """option = """ +
                    str(option) + """;""" + "")
    try:
        _ShutdownResult = ctx.element.shutdown(nodes=nodes, option=option)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_ShutdownResult), indent=4))
        return
    else:
        cli_utils.print_result(_ShutdownResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #17
0
def removeclusterpair(
        ctx,
        # Mandatory main parameter
        clusterpairid):
    """You can use the RemoveClusterPair method to close the open connections between two paired clusters."""
    """Note: Before you remove a cluster pair, you must first remove all volume pairing to the clusters with the "RemoveVolumePair" API method."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """clusterpairid = """ + str(clusterpairid) + """;""" + "")
    try:
        _RemoveClusterPairResult = ctx.element.remove_cluster_pair(
            cluster_pair_id=clusterpairid)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_RemoveClusterPairResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_RemoveClusterPairResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #18
0
def networking(
        ctx,
        # Mandatory main parameter
        force):
    """The RestartNetworking API method enables you to restart the networking services on a node."""
    """Warning: This method restarts all networking services on a node, causing temporary loss of networking connectivity."""
    """Exercise caution when using this method."""
    """Note: This method is available only through the per-node API endpoint 5.0 or later."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ """force = """ + str(force) + """;""" + "")
    try:
        _dict = ctx.element.restart_networking(force=force)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_dict), indent=4))
        return
    else:
        cli_utils.print_result(_dict,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #19
0
def completevolume(
        ctx,
        # Mandatory main parameter
        volumepairingkey,
        # Mandatory main parameter
        volumeid):
    """You can use the CompleteVolumePairing method to complete the pairing of two volumes."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """volumepairingkey = """ + str(volumepairingkey) + ";" +
                    """volumeid = """ + str(volumeid) + """;""" + "")
    try:
        _CompleteVolumePairingResult = ctx.element.complete_volume_pairing(
            volume_pairing_key=volumepairingkey, volume_id=volumeid)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_CompleteVolumePairingResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_CompleteVolumePairingResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #20
0
def list(ctx):
    """ListSchedule enables you to retrieve information about all scheduled snapshots that have been created."""

    if ctx.json is True:
        ctx.logger.error(
            "This command does not support the -j field. If you really need it, use sfapi invoke."
        )
        exit(1)

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _ListSchedulesResult = ctx.element.list_schedules()
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_ListSchedulesResult), indent=4))
        return
    else:
        cli_utils.print_result(_ListSchedulesResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #21
0
def disableauthentication(ctx):
    """The DisableLdapAuthentication method enables you to disable LDAP authentication and remove all LDAP configuration settings. This method does not remove any configured cluster admin accounts (user or group). However, those cluster admin accounts will no longer be able to log in."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _DisableLdapAuthenticationResult = ctx.element.disable_ldap_authentication(
        )
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(
                simplejson.loads(_DisableLdapAuthenticationResult), indent=4))
        return
    else:
        cli_utils.print_result(_DisableLdapAuthenticationResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #22
0
def listclusterpairs(ctx):
    """You can use the ListClusterPairs method to list all the clusters that a cluster is paired with. This method returns information about active and pending cluster pairings, such as statistics about the current pairing as well as the connectivity and latency (in milliseconds) of the cluster pairing."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _ListClusterPairsResult = ctx.element.list_cluster_pairs()
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_ListClusterPairsResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_ListClusterPairsResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #23
0
def getclusterinfo(
        ctx,
        # Optional main parameter
        type=None):
    """You can use the GetClusterHardwareInfo method to retrieve the hardware status and information for all Fibre Channel nodes, iSCSI"""
    """nodes and drives in the cluster. This generally includes details about manufacturers, vendors, versions, and other associated hardware"""
    """identification information."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ """type = """ + str(type) + """;""" + "")
    try:
        _GetClusterHardwareInfoResult = ctx.element.get_cluster_hardware_info(
            type=type)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_GetClusterHardwareInfoResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_GetClusterHardwareInfoResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #24
0
def removevolumepair(
        ctx,
        # Mandatory main parameter
        volumeid):
    """RemoveVolumePair enables you to remove the remote pairing between two volumes. Use this method on both the source and target volumes that are paired together. When you remove the volume pairing information, data is no longer replicated to or from the volume."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ """volumeid = """ + str(volumeid) + """;""" + "")
    try:
        _RemoveVolumePairResult = ctx.element.remove_volume_pair(
            volume_id=volumeid)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_RemoveVolumePairResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_RemoveVolumePairResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #25
0
def getnvraminfo(
        ctx,
        # Optional main parameter
        force=None):
    """GetNvramInfo enables you to retrieve information from each node about the NVRAM card."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ """force = """ + str(force) + """;""" + "")
    try:
        _GetNvramInfoResult = ctx.element.get_nvram_info(force=force)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_GetNvramInfoResult),
                               indent=4))
        return
    else:
        cli_utils.print_result(_GetNvramInfoResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #26
0
def startvolume(
        ctx,
        # Mandatory main parameter
        volumeid,
        # Optional main parameter
        mode=None):
    """StartVolumePairing enables you to create an encoded key from a volume that is used to pair with another volume. The key that this"""
    """method creates is used in the CompleteVolumePairing API method to establish a volume pairing."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """volumeid = """ + str(volumeid) + ";" + """mode = """ +
                    str(mode) + """;""" + "")
    try:
        _StartVolumePairingResult = ctx.element.start_volume_pairing(
            volume_id=volumeid, mode=mode)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_StartVolumePairingResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_StartVolumePairingResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
def list(
        ctx,
        # Optional main parameter
        volumeid=None,
        # Optional main parameter
        snapshotid=None):
    """ListSnapshots enables you to return the attributes of each snapshot taken on the volume. Information about snapshots that reside on the target cluster is displayed on the source cluster when this method is called from the source cluster."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """volumeid = """ + str(volumeid) + ";" +
                    """snapshotid = """ + str(snapshotid) + """;""" + "")
    try:
        _ListSnapshotsResult = ctx.element.list_snapshots(
            volume_id=volumeid, snapshot_id=snapshotid)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_ListSnapshotsResult), indent=4))
        return
    else:
        cli_utils.print_result(_ListSnapshotsResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #28
0
def listactivepairedvolumes(
        ctx,
        # Optional main parameter
        startvolumeid=None,
        # Optional main parameter
        limit=None):
    """ListActivePairedVolumes enables you to list all the active volumes paired with a volume. This method returns information about volumes with active and pending pairings."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """startvolumeid = """ + str(startvolumeid) + ";" +
                    """limit = """ + str(limit) + """;""" + "")
    try:
        _ListActivePairedVolumesResult = ctx.element.list_active_paired_volumes(
            start_volume_id=startvolumeid, limit=limit)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_ListActivePairedVolumesResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_ListActivePairedVolumesResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
def delete(
        ctx,
        # Mandatory main parameter
        snapshotid):
    """DeleteSnapshot enables you to delete a snapshot. A snapshot that is currently the "active" snapshot cannot be deleted. You must"""
    """rollback and make another snapshot "active" before the current snapshot can be deleted. For more details on rolling back snapshots, see RollbackToSnapshot."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """
                    """snapshotid = """ + str(snapshotid) + """;""" + "")
    try:
        _DeleteSnapshotResult = ctx.element.delete_snapshot(
            snapshot_id=snapshotid)
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(
            simplejson.dumps(simplejson.loads(_DeleteSnapshotResult),
                             indent=4))
        return
    else:
        cli_utils.print_result(_DeleteSnapshotResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)
Exemple #30
0
def list(ctx):
    """You can use ListServices to return the services information for nodes, drives, current software, and other services that are running on the cluster."""

    cli_utils.establish_connection(ctx)

    ctx.logger.info(""": """ + """;""" + "")
    try:
        _ListServicesResult = ctx.element.list_services()
    except common.ApiServerError as e:
        ctx.logger.error(e.message)
        exit()
    except BaseException as e:
        ctx.logger.error(e.__str__())
        exit()
    if ctx.json:
        print(simplejson.dumps(simplejson.loads(_ListServicesResult),
                               indent=4))
        return
    else:
        cli_utils.print_result(_ListServicesResult,
                               ctx.logger,
                               as_json=ctx.json,
                               as_pickle=ctx.pickle,
                               depth=ctx.depth,
                               filter_tree=ctx.filter_tree)