This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> docker info | |
Containers: 2 | |
Images: 4 | |
Server Version: swarm/1.1.3 | |
Role: primary | |
Strategy: spread | |
Filters: health, port, dependency, affinity, constraint | |
Nodes: 2 | |
vagrant-ubuntu-trusty-64: 172.28.128.6:2375 | |
└ Status: Healthy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from st2reactor.sensor.base import PollingSensor | |
import urllib2 | |
import json | |
import subprocess | |
from multiprocessing import Process | |
__all__ = [ | |
'PbPollingSensor' | |
] | |
class PbPollingSensor(PollingSensor): | |
def __init__(self, sensor_service, config=None, poll_interval=5): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: '2.0' | |
name: default.Gp4 | |
workflows: | |
main: | |
type: direct | |
tasks: | |
task1: | |
# [339, 45] | |
action: core.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListVMsAction(BaseAction): | |
api_type = 'compute' | |
def run(self, credentials, extra_kwargs=None): | |
driver = self._get_driver_for_credentials(credentials=credentials) | |
extra_kwargs = extra_kwargs or {} | |
vms = driver.list_nodes(**extra_kwargs) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: list_vms | |
runner_type: run-python | |
description: List available VMs. | |
enabled: true | |
entry_point: list_vms.py | |
parameters: | |
credentials: | |
type: string | |
description: Name of the credentials set (as defined in the config) to use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
chain: | |
- | |
name: "task1" | |
ref: "core.local" | |
params: | |
cmd: "echo 'foo'" | |
on-success: "task2" | |
- | |
name: "task2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from libcloud.compute.types import Provider | |
from libcloud.compute.providers import get_driver | |
cls = get_driver(Provider.OPENSTACK) | |
driver = cls('username', 'password', | |
ex_force_auth_version='3.x_password', | |
ex_force_auth_url='http://<controller ip>:5000', | |
ex_force_service_name='nova', | |
ex_force_service_region='regionOne', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./dist/verify_checksums.sh apache-libcloud-0.15.1 | |
Comparing checksums for version: apache-libcloud-0.15.1 | |
Downloaded files will be stored in: /tmp/tmp.ZMafH3Gnxo | |
Comparing checksums for file: apache-libcloud-0.15.1.tar.gz | |
Downloading file from Apache mirror... | |
Downloading file from PyPi mirror... | |
[OK] MD5 sum for file apache-libcloud-0.15.1.tar.gz matches | |
Comparing checksums for file: apache-libcloud-0.15.1.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from libcloud.storage.types import Provider | |
from libcloud.storage.providers import get_driver | |
cls = get_driver(Provider.OPENSTACK_SWIFT) | |
# 1. Specify all arguments | |
driver = cls('test:tester', 'testing', | |
region=None, | |
ex_force_auth_url='http://127.0.0.1:8888/auth/v1.0', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls = get_driver(Provider.OPENSTACK_SWIFT) | |
driver = cls('username', 'api_key', | |
ex_force_auth_version='2.0_apikey', | |
ex_force_service_type='object-store', | |
ex_force_service_name='cloudFiles') |