Ruby scripts that run outside the context of your installation are referred to as external scripts. These may be run standalone, or integrated into your installation with an external method hook (see: Registry method types).
The most basic example of an external script can be seen below:
require 'bcome' # Define an orchestrator orchestrator = ::Bcome::Orchestrator.instance # Load in a namespace namespace = orchestrator.get("some:namespace:breadcrumb") # Work with your namespace ...
All namespaces retrieved by the orchestrator are instances of @node.
To return the root namespace using the orchestrator, pass a null breadcrumb i.e.
See also @node methods for a list of public instance methods.
Any command available to you in the Console, using Keyed-Access or via the Registry is available to you within your Ruby scripts.
Some additional useful functions¶
Prompt for a metadata decryption key:
Silence command output:
Initiate an SSH connection to all server instances within a given namespace (rather than lazy-load them):
# with a progress bar ::Bcome::Ssh::Connector.connect(namespace, show_progress: true) # without a progress bar ::Bcome::Ssh::Connector.connect(namespace, show_progress: false)