vas.shared

Collection

class vas.shared.Collection.Collection[source]

Bases: vas.shared.Resource.Resource

A dynamic collection of items

Variables:security (vas.shared.Security.Security) – The resource’s security
reload()[source]

Reloads the resource’s details from the server

Configuration

class vas.shared.Configuration.Configuration[source]

Bases: vas.shared.Resource.Resource

A configuration file in an instance

Variables:
reload()[source]

Reloads the configuration’s details from the server

Deletable

class vas.shared.Deletable.Deletable[source]

Bases: object

The vas.shared.Deletable.Deletable mixin provides classes with support for deletion. The class must provide to instance variables: client and location.

delete()[source]

Performs a delete. If a collection is available it is reloaded.

Groups

class vas.shared.Groups.Group[source]

Bases: vas.shared.Resource.Resource, vas.shared.Deletable.Deletable

A collection of one or more nodes

Variables:
delete()

Performs a delete. If a collection is available it is reloaded.

reload()[source]

Reloads the group’s details from the server


class vas.shared.Groups.Groups[source]

Bases: vas.shared.MutableCollection.MutableCollection

A collection of groups

Variables:security (vas.shared.Security.Security) – The security configuration for the collection
create(name, nodes)[source]

Creates a new group

Parameters:
  • name (str) – The group’s name
  • nodes (list) – The group’s nodes
Return type:

vas.shared.Groups.Group

Returns:

The new group

reload()

Reloads the resource’s details from the server


class vas.shared.Groups.MutableGroup[source]

Bases: vas.shared.Groups.Group

A group that supports changes to it membership

Variables:
delete()

Performs a delete. If a collection is available it is reloaded.

reload()

Reloads the group’s details from the server

update(nodes)[source]

Update the group to contain the given nodes

Parameters:nodes (list) – The group’s nodes

InstallationImages

class vas.shared.InstallationImages.InstallationImage[source]

Bases: vas.shared.Resource.Resource, vas.shared.Deletable.Deletable

A product binary, typically are .zip or .tar.gz file, that has been uploaded to the server. Once created, an installation image can then be used to create an installation on a group.

Variables:
delete()

Performs a delete. If a collection is available it is reloaded.

reload()[source]

Reloads the installation image’s details from the server


class vas.shared.InstallationImages.InstallationImages[source]

Bases: vas.shared.MutableCollection.MutableCollection

A collection of installation images

Variables:security (vas.shared.Security.Security) – The resource’s security
create(path, version)[source]

Creates an installation image by uploading a file to the server and assigning it a version

Parameters:
  • path (str) – The path of the file to upload
  • version (str) – The installation image’s version
Return type:

vas.shared.InstallationImages.InstallationImage

Returns:

The new installation image

reload()

Reloads the resource’s details from the server

Installations

class vas.shared.Installations.Installation[source]

Bases: vas.shared.Resource.Resource, vas.shared.Deletable.Deletable

An installation of a middleware component. Created from an installation image. Once created, an installation is used when creating a new instance and provides the binaries that the instance uses at runtime.

Variables:
delete()

Performs a delete. If a collection is available it is reloaded.

reload()

Reloads the resource’s details from the server


class vas.shared.Installations.Installations[source]

Bases: vas.shared.MutableCollection.MutableCollection

A collection of installations

Variables:security (vas.shared.Security.Security) – The resource’s security
create(installation_image)[source]

Create a new installation

Parameters:installation_image (vas.shared.InstallationImages.InstallationImage) – The installation image to use to create the installation
Return type:vas.shared.Installations.Installation
Returns:The new installation
reload()

Reloads the resource’s details from the server

Instance

class vas.shared.Instance.Instance[source]

Bases: vas.shared.Resource.Resource, vas.shared.Deletable.Deletable

An instance of a middleware component. Created from an installation that provides the binaries that the instance uses at runtime.

Variables:
delete()

Performs a delete. If a collection is available it is reloaded.

reload()[source]

Reloads the instance’s details from the server

start(serial=False)[source]

Starts the resource

Parameters:serial (bool) – Whether to start the node instance serially
stop(serial=False)[source]

Stops the resource

Parameters:serial (bool) – Whether to stop the node instance serially

LiveConfiguration

class vas.shared.LiveConfiguration.LiveConfiguration[source]

Bases: vas.shared.Configuration.Configuration

A live configuration file in an instance

Variables:
  • content (str) – The configuration’s content
  • instance (vas.shared.Instance.Instance) – The instance that owns the configuration
  • path (str) – The configuration’s path
  • node_configurations (list) – The configuration’s node configurations
  • security (vas.shared.Security.Security) – The resource’s security
  • size (int) – The configuration’s size
reload()[source]

Reloads the live configuration’s details from the server

Logs

class vas.shared.Logs.Log[source]

Bases: vas.shared.Resource.Resource, vas.shared.Deletable.Deletable

A log file in a node instance

Variables:
content(start_line=None, end_line=None)[source]

Get the content of the log

Parameters:
  • start_line (int) – The start point, in lines, of the content to return. A value of None will result in content from the start of the file being returned. If the provided value is greater than the number of lines in the file, the returned content will be empty.
  • end_line (int) – The end point, in lines, of the content to return. A value of None will result in content up to the end of the file being returned. If the provided value is greater than the number of lines in the file, content up to and including the last line in the file will be returned.
Return type:

str

Returns:

The root directory of the extracted agent

delete()

Performs a delete. If a collection is available it is reloaded.

reload()[source]

Reloads the log’s details from the server


class vas.shared.Logs.Logs[source]

Bases: vas.shared.MutableCollection.MutableCollection

A node instance’s logs

Variables:security (vas.shared.Security.Security) – The resource’s security
reload()

Reloads the resource’s details from the server

MutableCollection

class vas.shared.MutableCollection.MutableCollection[source]

Bases: vas.shared.Collection.Collection

A collection that allows items to be created

Variables:security (vas.shared.Security.Security) – The resource’s security
reload()

Reloads the resource’s details from the server

NodeConfiguration

class vas.shared.NodeConfiguration.NodeConfiguration[source]

Bases: vas.shared.Resource.Resource

A configuration file in a node instance

Variables:
reload()[source]

Reloads the configuration’s details from the server

NodeInstances

class vas.shared.NodeInstances.NodeInstance[source]

Bases: vas.shared.StateResource.StateResource

A node instance, i.e. an instance on an individual node

Variables:
reload()

Reloads the resource’s details from the server

start()

Starts the resource

stop()

Stops the resource


class vas.shared.NodeInstances.NodeInstances[source]

Bases: vas.shared.Collection.Collection

A collection of node instances

Variables:security (vas.shared.Security.Security) – The resource’s security
reload()

Reloads the resource’s details from the server

Nodes

class vas.shared.Nodes.Node[source]

Bases: vas.shared.Resource.Resource

A node, i.e. a machine with the vFabric Administration agent installed on it

Variables:
  • agent_home (str) – The location of the vFabric Administration Agent
  • architecture (str) – The architecture of the node’s operating system
  • host_names (list) – The node’s host names
  • ip_addresses (list) – The node’s IP addresses
  • ipv4_addresses (list) – The node’s IPv4 addresses
  • ipv6_addresses (list) – The node’s IPv6 addresses
  • metadata (dict) – The node’s metadata
  • operating_system (str) – The node’s operating system
  • security (vas.shared.Security.Security) – The resource’s security
reload()[source]

Reloads the node’s details from the server

update(metadata)[source]

Updates the node’s metadata

Parameters:metadata (dict) – The node’s new metadata

class vas.shared.Nodes.GroupableNode[source]

Bases: vas.shared.Nodes.Node

A node that can be grouped

Variables:
  • agent_home (str) – The location of the vFabric Administration Agent
  • architecture (str) – The architecture of the node’s operating system
  • groups (list) – The groups that contain this node
  • host_names (list) – The node’s host names
  • ip_addresses (list) – The node’s IP addresses
  • ipv4_addresses (list) – The node’s IPv4 addresses
  • ipv6_addresses (list) – The node’s IPv6 addresses
  • metadata (dict) – The node’s metadata
  • operating_system (str) – The node’s operating system
  • security (vas.shared.Security.Security) – The resource’s security
reload()[source]

Reloads the node’s details from the server

update(metadata)

Updates the node’s metadata

Parameters:metadata (dict) – The node’s new metadata

PendingConfigurations

class vas.shared.PendingConfigurations.PendingConfiguration[source]

Bases: vas.shared.Configuration.Configuration, vas.shared.Deletable.Deletable

A configuration file that is pending and will be made live the next time its instance is started

Variables:
delete()

Performs a delete. If a collection is available it is reloaded.

reload()

Reloads the configuration’s details from the server


class vas.shared.PendingConfigurations.PendingConfigurations[source]

Bases: vas.shared.MutableCollection.MutableCollection

A collection of an instance’s pending configurations

Variables:security (vas.shared.Security.Security) – The resource’s security
create(path, content)[source]

Creates a new configuration. The configuration will be pending until its instance is started at which point the configuration will become live.

Parameters:
  • path (str) – The configuration’s path
  • content (str) – The configuration’s content
Return type:

vas.shared.PendingConfigurations.PendingConfiguration

Returns:

The new configuration

reload()

Reloads the resource’s details from the server

Resource

class vas.shared.Resource.Resource[source]

Bases: object

The base of all types that interact with the REST API. A resource should map to a specific URI in the REST API.

Variables:security (vas.shared.Security.Security) – The resource’s security
reload()[source]

Reloads the resource’s details from the server

Security

class vas.shared.Security.Security[source]

Bases: object

The security configuration for a resource

Variables:
  • group (str) – the group of the resource
  • owner (str) – the owner of the resource
  • permissions (dict) –

    The permissions of the resource. This dict contains keys of owner, group, and other. The value for any of those keys is a list which contains any of READ, WRITE, and EXECUTE. For example:

    {
        'owner': ['READ', 'WRITE', 'EXECUTE'],
        'group': ['READ', 'WRITE'],
        'other': ['READ']
    }
chmod(owner=None, group=None, other=None)[source]

Change the permissions for an item or collection. Analogous to the UNIX chmod command.

Parameters:
  • owner (list) – The new owner class permissions of the item or collection. Legal values are any of READ, WRITE, and EXECUTE. Unchanged if None.
  • group (list) – The new group class permissions of the item or collection. Legal values are any of READ, WRITE, and EXECUTE. Unchanged if None.
  • other (list) – The new other class permissions of the item or collection. Legal values are any of READ, WRITE, and EXECUTE. Unchanged if None.
chown(owner=None, group=None)[source]

Change the owner and group security configuration for an item or collection. Analogous to the UNIX chown command.

Parameters:
  • owner (str) – The new owner of the item or collection. Unchanged if None.
  • group (str) – The new group of the item or collection. Unchanged if None.
reload()[source]

Reloads the security configuration from the server

StateResource

class vas.shared.StateResource.StateResource[source]

Bases: vas.shared.Resource.Resource

A resource that has state, i.e. it can be started and stopped and its state can be queried

Variables:
  • security (vas.shared.Security.Security) – The resource’s security
  • state (str) –

    Retrieves the state of the resource from the server. Will be one of:

    • STARTING
    • STARTED
    • STOPPING
    • STOPPED
reload()

Reloads the resource’s details from the server

start()[source]

Starts the resource

stop()[source]

Stops the resource