Package: fabric-mgmt-cli
ManagementCliFabric Control Framework Management CLI for administrative operations over KafkaOverviewManagement CLI talks to various CF components over Kafka to query and perform various administrative operations.
Below is the list of the operations supported so farCommandSubCommandActionInputOutputdelegationsclaimClaim delegation(s) from AM to BrokerbrokerBroker,amAggregate Manager,did[Delegation Id]Delegation Id of delegation claimeddelegationsreclaimReclaim delegation(s) from Broker to AMbrokerBroker,amAggregate Manager,did[Delegation Id]Delegation Id of delegation reclaimeddelegationsqueryGet delegation(s) from an actoractorActor,did[Delegation Id]Delegations for an actor or Delegation identified by Delegation IdslicescloseCloses slice for an actoractorActor,sliceid[Slice Id]Success or Failure statusslicesremoveRemoves slice for an actoractorActor,sliceid[Slice Id]Success or Failure statusslicesqueryGet slice(s) from an actoractorActor,sliceid[Slice Id]Slices for an actor or Slice identified by Slice IdsliversremoveCloses sliver for an actoractorActor,sliverid[Sliver Id]Success or Failure statussliverscloseRemoves sliver for an actoractorActor,sliverid[Sliver Id]Success or Failure statussliversqueryGet sliver(s) from an actoractorActor,sliverid[Sliver Id]Reservations for an actor or Sliver identified by Sliver IdRequirementsPython 3.7+Pre-requisitesEnsure that following are installedvirtualenvvirtualenvwrapperInstallationMultiple installation options possible. For CF development the recommended method is to install from GitHub MASTER branch:$ mkvirtualenv mgmtcli
$ workon mgmtcli
$ pip install git+https://github.com/fabric-testbed/ManagementCli.gitFor inclusion in tools, etc, use PyPi$ mkvirtualenv mgmtcli
$ workon mgmtcli
$ pip install fabric-mgmt-cliConfigurationManagement CLI expects the user to setFABRIC_MGMT_CLI_CONFIG_PATHenvironment variable from whereconfig.ymlto be picked.
If the environment variable is not set, it will try to look forconfig.ymlin users home directory.In addition, User is expected to pass either Fabric Identity Token or Fabric Refresh Token to all the commands.
Alternatively, user is expected to set atleast one of the environment variablesFABRIC_ID_TOKENandFABRIC_REFRESH_TOKEN.Create config.yml with default content as shown below.User is expected to update the following parameters:Kafka Cluster ParametersCF Peers with Kafka topicsLog File Locationruntime:
  - kafka-topic: managecli-topic
  - kafka-server: broker1:9092
  - kafka-schema-registry-url: http://schemaregistry:8081
  - kafka-key-schema: /etc/fabric/message_bus/schema/key.avsc
  - kafka-value-schema: /etc/fabric/message_bus/schema/message.avsc
  - kafka-ssl-ca-location:  /etc/fabric/message_bus/ssl/cacert.pem
  - kafka-ssl-certificate-location:  /etc/fabric/message_bus/ssl/client.pem
  - kafka-ssl-key-location:  /etc/fabric/message_bus/ssl/client.key
  - kafka-ssl-key-password:  fabric
  - kafka-security-protocol: SSL
  - kafka-group-id: fabric-cf
  - kafka-sasl-mechanism:
  - kafka-sasl-producer-username:
  - kafka-sasl-producer-password:
  - kafka-sasl-consumer-username:
  - kafka-sasl-consumer-password:

logging:
  ## The directory in which actor should create log files.
  ## This directory will be automatically created if it does not exist.
  - log-directory: /var/log/managecli

  ## The filename to be used for actor's log file.
  - log-file: manage.log

  ## The default log level for actor.
  - log-level: DEBUG

  ## actor rotates log files. You may specify how many archived log files to keep here.
  - log-retain: 5

  ## actor rotates log files after they exceed a certain size.
  ## You may specify the file size that results in a log file being rotated here.
  - log-size: 5000000

  - logger: managecli
auth:
  - name: managecli
  - guid: managecli-guid
  - credmgr-host: https://dev-2.fabric_mgmt_cli-testbed.net/

peers:
  - peer:
    - name: orchestrator
    - type: orchestrator
    - guid: orchestrator-guid
    - kafka-topic: orchestrator-topic
  - peer:
    - name: net1-am
    - guid: net1-am-guid
    - type: authority
    - kafka-topic: net1-am-topic
  - peer:
    - name: site1-am
    - guid: site1-am-guid
    - type: authority
    - kafka-topic: site1-am-topic
  - peer:
      - name: broker
      - guid: broker-guid
      - type: broker
      - kafka-topic: broker-topicUsageManagement CLI supports show and manage commands:$ fabric-mgmt-cli
Usage: fabric-mgmt-cli [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose
  --help         Show this message and exit.

Commands:
  delegations  Delegation management
  maintenance  Maintenance Operations
  net          Dataplane network management
  slices       Slice management
  slivers      Sliver managementDelegation CommandsList of the delegation commands supported can be found below:$ fabric-mgmt-cli delegations
Usage: fabric-mgmt-cli delegations [OPTIONS] COMMAND [ARGS]...

  Delegation management

Options:
  --help  Show this message and exit.

Commands:
  claim    Claim delegation(s) from AM to Broker
  close    Closes delegation for an actor
  query    Get delegation(s) from an actor
  reclaim  Reclaim delegation(s) from Broker to AM
  remove   Removes sliver for an actorSlice CommandsList of the Slice commands supported can be found below:$ fabric-mgmt-cli slices
Usage: fabric-mgmt-cli slices [OPTIONS] COMMAND [ARGS]...

  Slice management

Options:
  --help  Show this message and exit.

Commands:
  close          Closes slice for an actor
  query          Get slice(s) from an actor
  remove         Removes slice for an actor
  removealldead  Removes slice for an actorSliver CommandsList of the Sliver commands supported can be found below:$ fabric-mgmt-cli slivers
Usage: fabric-mgmt-cli slivers [OPTIONS] COMMAND [ARGS]...

  Sliver management

Options:
  --help  Show this message and exit.

Commands:
  close   Closes sliver for an actor
  query   Get sliver(s) from an actor
  remove  Removes sliver for an actorMaintenance CommandsList of the Maintenance commands supported can be found below:$ fabric-mgmt-cli maintenance
Usage: fabric-mgmt-cli maintenance [OPTIONS] COMMAND [ARGS]...

  Maintenance Operations

Options:
  --help  Show this message and exit.

Commands:
  site     Change Maintenance modes (PreMaint, Maint, Active) for a
           specific...

  testbed  Change Maintenance modes (PreMaint, Maint, Active) for the...ExamplesNOTE: Specific projects/users can still be allowed to provision by passing:Comma separated list of email addresses of the allowed users in the argument--usersCommand separated list of the allowed project ids in the argument--projectsChange Testbed Maintenance ModeMove Testbed in Pre-Maintenance Mode.$ fabric-mgmt-cli maintenance testbed --actor orchestrator --mode PreMaint --deadline '2022-12-26T22:29:51.214418+00:00' --end '2022-12-30T22:29:51.214418+00:00'Move Testbed in Maintenance Mode.$ fabric-mgmt-cli maintenance testbed --actor orchestrator --mode MaintMove Testbed in Active Mode$ fabric-mgmt-cli maintenance testbed --actor orchestrator --mode ActiveChange Site Maintenance ModeMove Site in Pre-Maintenance Mode.$ fabric-mgmt-cli maintenance site --name RENC --actor orchestrator --mode PreMaint --deadline '2022-12-26T22:29:51.214418+00:00' --end '2022-12-30T22:29:51.214418+00:00'Move Site in Maintenance Mode.$ fabric-mgmt-cli maintenance site --name RENC --actor orchestrator --mode MaintMove Site in Active Mode$ fabric-mgmt-cli maintenance site --name RENC --actor orchestrator --mode ActiveChange Worker Maintenance ModeMove Worker in Pre-Maintenance Mode.$ fabric-mgmt-cli maintenance site --name RENC --actor orchestrator --mode PreMaint --deadline '2022-12-26T22:29:51.214418+00:00' --end '2022-12-30T22:29:51.214418+00:00' --workers renc-w1.fabric-testbed.netMove Worker in Maintenance Mode.$ fabric-mgmt-cli maintenance site --name RENC --actor orchestrator --mode Maint --workers renc-w1.fabric-testbed.netMove Worker in Active Mode$ fabric-mgmt-cli maintenance site --name RENC --actor orchestrator --mode Active --workers renc-w1.fabric-testbed.netNetwork Management CommandsList of the Network Management commands supported can be found below:$ fabric-mgmt-cli net
Usage: fabric-mgmt-cli net [OPTIONS] COMMAND [ARGS]...

  Dataplane network management

Options:
  --help  Show this message and exit.

Commands:
  create  Create a new network service
  delete  Delete an existing network service by name
  show    Subgroup for network information commands
  sync    Control NSO device synchronization