Skip to content

Instantly share code, notes, and snippets.

@specs.parameter('entry_point', yaqltypes.String())
def publish_blueprint(self, entry_point):
global archive_upload_lock
if self._check_blueprint_exists():
return
path = self._application_package.get_resource(entry_point)
with archive_upload_lock:
try:
self._client.blueprints.upload(
./
| LICENSE
| logo.png
| manifest.yaml
| README.rst
Format: Cloudify.TOSCA/1.0
Type: Application
FullName: org.getcloudify.muranoapps.examples.MyApp
EntryPoint: some-blueprint.yaml
Name: My App
policy_types:
scale_policy_type:
source: scale.clj
properties:
service_selector:
description: regular expression that selects the metric to be measured
default: ".*"
moving_window_size:
description: the moving window for individual sources in secs
default: 10
kube_scale:
mapping: kubernetes.kube_plugin.workflows.kube_scale
parameters:
master:
description: name of master node or proxy
ssh_user:
description: ssh user used to run kubectl on master
ssh_keyfilename:
description: private key for ssh
name:
- file: pod.yaml
overrides:
........
- "['spec']['template']['spec']['containers'][1]['env'][2]['value'] = '%{deployment.id}'"
......
config_files:
- file: pod.yaml
overrides:
........
- "['spec']['template']['spec']['containers'][1]['env'][0]['value'] = '%{management_ip}'"
......
(let [hostcnt (:metric (riemann.index/lookup index nil "hostcount"))
conns (/ (:metric ev) (max hostcnt 1))
cooling (not (nil? (riemann.index/lookup index "scaling" "suspended")))
]
(if (and (not cooling) ({{scale_direction}} hostcnt {{scale_limit}}) ({{scale_direction}} {{scale_threshold}} conns))
(do
(process-policy-triggers ev)
(riemann.index/update index {:host "scaling" :service "suspended" :time (unix-time) :description "cooldown flag" :metric 0 :ttl {{cooldown_time}} :state "ok"})
)
)
order_manager:
- 'create_order'
- 'view_order'
- 'delete_order'
- 'update_order'
order_inspector:
- 'viewer_order'
order_manager:
'/orders':
- 'GET'
- 'POST'
- 'PUT'
- 'DELETE'
order_editor:
'/orders':
- 'GET'
- 'POST'