Skip to content

Instantly share code, notes, and snippets.

@hatched

hatched/cmd.js Secret

Created March 28, 2014 21:14
Show Gist options
  • Save hatched/0cea96d605a2b8cbb2c7 to your computer and use it in GitHub Desktop.
Save hatched/0cea96d605a2b8cbb2c7 to your computer and use it in GitHub Desktop.
db push
function createData() {
return {
charms: [
eval({"type":"charm","initialized":true,"destroyed":false,"clientId":"browser-charm_28","id":"cs:precise/mysql-38","storeId":"precise/mysql-38","categories":["databases"],"changelog":{},"charm_path":"charms/precise/mysql-38/json","code_source":{"bugs_link":"https://bugs.launchpad.net/charms/+source/mysql","last_log":"If ip is an ip then return ip","location":"lp:~charmers/charms/precise/mysql/trunk","revision":"116","revisions":[{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2014-03-18T20:08:18Z","message":"If ip is an ip then return ip","revno":116},{"authors":[{"email":"chuck@dasroot.net","name":"Charles Butler"}],"date":"2014-03-18T15:28:40Z","message":"[marcoceppi] Remove dependency on charm-helpers-sh\n","revno":115},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2014-03-04T16:23:59Z","message":"[francois-ctrlaltdel] Fix mysql client invocation command in the doc\n","revno":114},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2014-02-15T23:08:38Z","message":"[marcoceppi] Better assurances that MySQL will restart\n","revno":113},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2014-02-13T23:30:01Z","message":"[hopem] added support for ceph-client use_rsyslog option\n","revno":112},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2014-02-04T21:48:29Z","message":"[hopem] Adds support for configurable ceph pool\n","revno":111},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2014-01-07T12:55:55Z","message":"[robert-ayres] Fix binlog-format config option\n","revno":110},{"authors":[{"email":"jorge@ubuntu.com","name":"Jorge O. Castro"}],"date":"2013-12-12T17:26:49Z","message":"Last retructure of README for charm audit.\n","revno":109},{"authors":[{"email":"jorge@ubuntu.com","name":"Jorge O. Castro"}],"date":"2013-12-12T17:08:00Z","message":"Set default vip setting to '' to pass proof.\n","revno":108},{"authors":[{"email":"jorge@ubuntu.com","name":"Jorge O. Castro"}],"date":"2013-12-12T17:02:19Z","message":"Update readme with more information.\n","revno":107}],"type":"bzr"},"commitCount":116,"date_created":"2012-04-16T18:30:00Z","description":"MySQL is a fast, stable and true multi-user, multi-threaded SQL database\nserver. SQL (Structured Query Language) is the most popular database query\nlanguage in the world. The main goals of MySQL are speed, robustness and\nease of use.\n","providers":null,"downloads":18700,"files":["config.yaml","icon.svg","metadata.yaml","README.md","revision","hooks/ceph-relation-changed","hooks/ceph-relation-joined","hooks/cluster-relation-changed","hooks/common.py","hooks/config-changed","hooks/db-admin-relation-joined","hooks/db-relation-broken","hooks/db-relation-joined","hooks/ha_relations.py","hooks/ha-relation-changed","hooks/ha-relation-joined","hooks/install","hooks/lib/__init__.py","hooks/lib/ceph_utils.py","hooks/lib/cluster_utils.py","hooks/lib/utils.py","hooks/local-monitors-relation-joined","hooks/master-relation-broken","hooks/master-relation-changed","hooks/master-relation-departed","hooks/monitors-relation-broken","hooks/monitors-relation-departed","hooks/monitors-relation-joined","hooks/monitors.common.bash","hooks/munin-relation-changed","hooks/munin-relation-joined","hooks/shared_db_relations.py","hooks/shared-db-relation-changed","hooks/shared-db-relation-joined","hooks/slave-relation-broken","hooks/slave-relation-changed","hooks/slave-relation-departed","hooks/slave-relation-joined","hooks/start","hooks/stop","hooks/upgrade-charm"],"full_name":"precise/mysql","shouldShowIcon":true,"is_approved":true,"is_subordinate":false,"maintainer":{"email":"marco@ceppi.net","name":"Marco Ceppi"},"metadata":{"doctype":"charm"},"name":"mysql","options":{"binlog-format":{"default":"MIXED","description":"If binlogging is enabled, this is the format that will be used. Ignored when tuning-level == fast.","type":"string"},"block-size":{"default":5,"description":"Default block storage size to create when setting up MySQL block storage.\nThis value should be specified in GB (e.g. 100 not 100GB).\n","type":"int"},"ceph-osd-replication-count":{"default":2,"description":"This value dictates the number of replicas ceph must make of any\nobject it stores within the mysql rbd pool. Of course, this only\napplies if using Ceph as a backend store. Note that once the mysql\nrbd pool has been created, changing this value will not have any\neffect (although it can be changed in ceph by manually configuring\nyour ceph cluster).\n","type":"int"},"dataset-size":{"default":"80%","description":"How much data do you want to keep in memory in the DB. This will be used to tune settings in the database server appropriately. Any more specific settings will override these defaults though. This currently sets innodb_buffer_pool_size or key_cache_size depending on the setting in preferred-storage-engine. If query-cache-type is set to 'ON' or 'DEMAND' 20% of this is given to query-cache-size. Suffix this value with 'K','M','G', or 'T' to get the relevant kilo/mega/etc. bytes. If suffixed with %, one will get that percentage of RAM devoted to dataset and (if enabled) query cache.","type":"string"},"flavor":{"default":"distro","description":"Possible values are 'distro' or 'percona'","type":"string"},"ha-bindiface":{"default":"eth0","description":"Default network interface on which HA cluster will bind to communication\nwith the other members of the HA Cluster.\n","type":"string"},"ha-mcastport":{"default":5411,"description":"Default multicast port number that will be used to communicate between\nHA Cluster nodes.\n","type":"int"},"max-connections":{"default":-1,"description":"Maximum connections to allow. -1 means use the server's compiled in default.","type":"int"},"preferred-storage-engine":{"default":"InnoDB","description":"Tune the server for usage of this storage engine. Other possible value is MyISAM. Comma separated will cause settings to split resources evenly among given engines.","type":"string"},"query-cache-size":{"default":-1,"description":"Override the computed version from dataset-size. Still works if query-cache-type is \"OFF\" since sessions can override the cache type setting on their own.","type":"int"},"query-cache-type":{"default":"OFF","description":"Query cache is usually a good idea, but can hurt concurrency. Valid values are \"OFF\", \"ON\", or \"DEMAND\". http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_query_cache_type","type":"string"},"rbd-name":{"default":"mysql1","description":"The name that will be used to create the Ceph's RBD image with. If the\nimage name exists in Ceph, it will be re-used and the data will be\noverwritten.\n","type":"string"},"tuning-level":{"default":"safest","description":"Valid values are 'safest', 'fast', and 'unsafe'. If set to safest, all settings are tuned to have maximum safety at the cost of performance. Fast will turn off most controls, but may lose data on crashes. unsafe will turn off all protections.","type":"string"},"vip":{"default":"","description":"Virtual IP to use to front mysql in ha configuration","type":"string"},"vip_cidr":{"default":24,"description":"Netmask that will be used for the Virtual IP","type":"int"},"vip_iface":{"default":"eth0","description":"Network Interface where to place the Virtual IP","type":"string"}},"provides":{"db":{"interface":"mysql"},"db-admin":{"interface":"mysql-root"},"local-monitors":{"interface":"local-monitors","scope":"container"},"master":{"interface":"mysql-oneway-replication"},"monitors":{"interface":"monitors"},"munin":{"interface":"munin-node"},"shared-db":{"interface":"mysql-shared"}},"rating_numerator":0,"rating_denominator":0,"recent_commit_count":0,"recentCommits":[{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2014-03-18T20:08:18.000Z","message":"If ip is an ip then return ip","revno":116},{"author":{"name":"Charles Butler","email":"chuck@dasroot.net"},"date":"2014-03-18T15:28:40.000Z","message":"[marcoceppi] Remove dependency on charm-helpers-sh\n","revno":115},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2014-03-04T16:23:59.000Z","message":"[francois-ctrlaltdel] Fix mysql client invocation command in the doc\n","revno":114},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2014-02-15T23:08:38.000Z","message":"[marcoceppi] Better assurances that MySQL will restart\n","revno":113},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2014-02-13T23:30:01.000Z","message":"[hopem] added support for ceph-client use_rsyslog option\n","revno":112},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2014-02-04T21:48:29.000Z","message":"[hopem] Adds support for configurable ceph pool\n","revno":111},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2014-01-07T12:55:55.000Z","message":"[robert-ayres] Fix binlog-format config option\n","revno":110},{"author":{"name":"Jorge O. Castro","email":"jorge@ubuntu.com"},"date":"2013-12-12T17:26:49.000Z","message":"Last retructure of README for charm audit.\n","revno":109},{"author":{"name":"Jorge O. Castro","email":"jorge@ubuntu.com"},"date":"2013-12-12T17:08:00.000Z","message":"Set default vip setting to '' to pass proof.\n","revno":108},{"author":{"name":"Jorge O. Castro","email":"jorge@ubuntu.com"},"date":"2013-12-12T17:02:19.000Z","message":"Update readme with more information.\n","revno":107}],"recent_download_count":1679,"relations":{"provides":{"db":{"interface":"mysql"},"db-admin":{"interface":"mysql-root"},"local-monitors":{"interface":"local-monitors","scope":"container"},"master":{"interface":"mysql-oneway-replication"},"monitors":{"interface":"monitors"},"munin":{"interface":"munin-node"},"shared-db":{"interface":"mysql-shared"}},"requires":{"ceph":{"interface":"ceph-client"},"ha":{"interface":"hacluster","scope":"container"},"slave":{"interface":"mysql-oneway-replication"}}},"requires":{"ceph":{"interface":"ceph-client"},"ha":{"interface":"hacluster","scope":"container"},"slave":{"interface":"mysql-oneway-replication"}},"revision":38,"scheme":"cs","series":"precise","summary":"MySQL is a fast, stable and true multi-user, multi-threaded SQL database","tested_providers":{},"url":"cs:precise/mysql-38","package_name":"mysql"}),
eval({"type":"charm","initialized":true,"destroyed":false,"clientId":"browser-charm_38","id":"cs:precise/wordpress-21","storeId":"precise/wordpress-21","categories":["applications"],"changelog":{},"charm_path":"charms/precise/wordpress-21/json","code_source":{"bugs_link":"https://bugs.launchpad.net/charms/+source/wordpress","last_log":"README and Metadata audit updates.\n","location":"lp:~charmers/charms/precise/wordpress/trunk","revision":"72","revisions":[{"authors":[{"email":"jorge@ubuntu.com","name":"Jorge O. Castro"}],"date":"2013-12-12T18:42:28Z","message":"README and Metadata audit updates.\n","revno":72},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2013-10-13T03:20:18Z","message":"Jorge O. Castro 2013-09-26 Update single node instructions.\n","revno":71},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2013-09-27T18:31:25Z","message":"Fix modprobe for local deployments","revno":70},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2013-09-25T13:57:32Z","message":" Dave Cheney 2013-09-09 responding to review feedback\n Dave Cheney 2013-09-06 set -e in install hook\n","revno":69},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2013-09-19T12:18:50Z","message":"Include -o only if there are options","revno":68},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2013-08-10T21:49:31Z","message":" Tim Penhey 2013-08-02 Avoid hostname -f as per manpage instructions.\n","revno":67},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2013-05-06T21:44:18Z","message":"Skip the loadbalancer and talk directly to each unit on 8080","revno":66},{"authors":[{"email":"kapil.foss@gmail.com","name":"Kapil Thangavelu"}],"date":"2013-04-30T06:01:25Z","message":"correct port address in website-relation-joined","revno":65},{"authors":[{"email":"marco@ceppi.net","name":"Marco Ceppi"}],"date":"2013-04-25T18:16:26Z","message":"Added icon.svg","revno":64},{"authors":[{"email":"jorge@ubuntu.com","name":"Jorge O. Castro"}],"date":"2013-04-22T19:34:36Z","message":"Add a category\n","revno":63}],"type":"bzr"},"commitCount":72,"date_created":"2012-04-16T18:29:14Z","description":"This will install and setup WordPress optimized to run in the cloud. By default it will \nplace Ngnix and php-fpm configured to scale horizontally with Nginx's reverse proxy.\n","providers":null,"downloads":10171,"files":["config.yaml","icon.svg","metadata.yaml","README.md","revision","hooks/cache-relation-broken","hooks/cache-relation-changed","hooks/cache-relation-departed","hooks/config-changed","hooks/db-relation-broken","hooks/db-relation-changed","hooks/db-relation-departed","hooks/install","hooks/loadbalancer-rebuild","hooks/loadbalancer-relation-broken","hooks/loadbalancer-relation-changed","hooks/loadbalancer-relation-departed","hooks/loadbalancer-relation-joined","hooks/nfs-relation-broken","hooks/nfs-relation-changed","hooks/nfs-relation-departed","hooks/restart","hooks/start","hooks/stop","hooks/upgrade-charm","hooks/website-relation-joined"],"full_name":"precise/wordpress","shouldShowIcon":true,"is_approved":true,"is_subordinate":false,"maintainer":{"email":"marco@ceppi.net","name":"Marco Ceppi"},"metadata":{"doctype":"charm"},"name":"wordpress","options":{"debug":{"default":"no","description":"Setting this option to \"yes\" will expose /_debug on all instances over HTTP. In the _debug folder are two scripts, info.php and apc.php. info.php will display the phpinfo information for that server while the apc.php will provide APC cache stats (as well as additional administrative options for APC).\n","type":"string"},"engine":{"default":"nginx","description":"Currently two web server engines are supported: nginx and apache. For the majority of deployments nginx will be the prefered choice. See the Readme for more details","type":"string"},"tuning":{"default":"single","description":"This is the tuning level for the WordPress setup. There are three options: \"bare\", \"single\", and \"optimized\". \"bare\" will give you a nearly un-altered WordPress setup, as if you'd downloaded and set it up yourself. \"single\" will provide you with everything you need to run a singlular unit of WordPress. This doesn't take in to consideration that you'll be scaling at all. However, it will allow you to use WordPress free of any troubles and pesky limitations that typically happen during \"optimized\". While you _can_ scale out with this setting I encourage you read the README \"optimized\" will give you a hardened WordPress setup. Some of the features in the Admin panel will be locked down and theme edits/plugins can only be updated through he charm. This is the recommended setup for those who are in serious need of constant scaling. \n","type":"string"},"wp-content":{"default":"","description":"This is a full repository path to where the WordPress wp-contents can be found. At this time Git, BZR, SVN, and HG are supported. An example of what a wp-content repository should look like can be found at http://github.com/jujutools/wordpress-site.\n","type":"string"}},"provides":{"website":{"interface":"http"}},"rating_numerator":0,"rating_denominator":0,"recent_commit_count":0,"recentCommits":[{"author":{"name":"Jorge O. Castro","email":"jorge@ubuntu.com"},"date":"2013-12-12T18:42:28.000Z","message":"README and Metadata audit updates.\n","revno":72},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2013-10-13T03:20:18.000Z","message":"Jorge O. Castro 2013-09-26 Update single node instructions.\n","revno":71},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2013-09-27T18:31:25.000Z","message":"Fix modprobe for local deployments","revno":70},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2013-09-25T13:57:32.000Z","message":" Dave Cheney 2013-09-09 responding to review feedback\n Dave Cheney 2013-09-06 set -e in install hook\n","revno":69},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2013-09-19T12:18:50.000Z","message":"Include -o only if there are options","revno":68},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2013-08-10T21:49:31.000Z","message":" Tim Penhey 2013-08-02 Avoid hostname -f as per manpage instructions.\n","revno":67},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2013-05-06T21:44:18.000Z","message":"Skip the loadbalancer and talk directly to each unit on 8080","revno":66},{"author":{"name":"Kapil Thangavelu","email":"kapil.foss@gmail.com"},"date":"2013-04-30T06:01:25.000Z","message":"correct port address in website-relation-joined","revno":65},{"author":{"name":"Marco Ceppi","email":"marco@ceppi.net"},"date":"2013-04-25T18:16:26.000Z","message":"Added icon.svg","revno":64},{"author":{"name":"Jorge O. Castro","email":"jorge@ubuntu.com"},"date":"2013-04-22T19:34:36.000Z","message":"Add a category\n","revno":63}],"recent_download_count":681,"relations":{"provides":{"website":{"interface":"http"}},"requires":{"cache":{"interface":"memcache"},"db":{"interface":"mysql"},"nfs":{"interface":"mount"}}},"requires":{"cache":{"interface":"memcache"},"db":{"interface":"mysql"},"nfs":{"interface":"mount"}},"revision":21,"scheme":"cs","series":"precise","summary":"WordPress is a full featured web blogging tool, this charm deploys it.","tested_providers":{},"url":"cs:precise/wordpress-21","package_name":"wordpress"})
],
relations: [
eval({"relation_id":"wordpress:db mysql:db","endpoints":[["wordpress",{"role":"client","name":"db"}],["mysql",{"role":"server","name":"db"}]],"pending":false,"scope":"global","display_name":"db:db","interface":"mysql"})
],
services: [
eval({"loaded":true,"initialized":true,"destroyed":false,"clientId":"service_29","id":"mysql","displayName":"mysql","charm":"cs:precise/mysql-38","icon":"https://manage.jujucharms.com/api/3/charm/precise/mysql-38/file/icon.svg","config":{"binlog-format":"MIXED","block-size":5,"ceph-osd-replication-count":2,"dataset-size":"80%","flavor":"distro","ha-bindiface":"eth0","ha-mcastport":5411,"max-connections":-1,"preferred-storage-engine":"InnoDB","query-cache-size":-1,"query-cache-type":"OFF","rbd-name":"mysql1","tuning-level":"safest","vip":"","vip_cidr":24,"vip_iface":"eth0"},"annotations":{"gui-x":"-510.5","gui-y":"-57"},"charmChanged":false,"constraints":{},"exposed":false,"subordinate":false,"pending":false,"life":"alive","unit_count":1,"units":[{"id":"mysql/0","charmUrl":"cs:precise/mysql-38","service":"mysql","machine":"0","agent_state":"started","open_ports":[],"clientId":"serviceUnit_35","number":0,"urlName":"mysql-0","name":"serviceUnit","displayName":"mysql/0"}],"relations":[{"interface":"mysql","relation_id":"wordpress:db mysql:db","endpoints":[["wordpress",{"role":"client","name":"db"}],["mysql",{"role":"server","name":"db"}]],"pending":false,"scope":"global","display_name":"db:db"}],"relationChangeTrigger":{"error":{}},"upgrade_available":false,"upgrade_to":"cs:undefined","aggregated_status":{"running":1},"packageName":"mysql","loading":false}),
eval({"loaded":true,"initialized":true,"destroyed":false,"clientId":"service_39","id":"wordpress","displayName":"wordpress","charm":"cs:precise/wordpress-21","icon":"https://manage.jujucharms.com/api/3/charm/precise/wordpress-21/file/icon.svg","config":{"debug":"no","engine":"nginx","tuning":"single","wp-content":""},"annotations":{"gui-x":"-180.5","gui-y":"-161"},"charmChanged":false,"constraints":{},"exposed":false,"subordinate":false,"pending":false,"life":"alive","unit_count":1,"units":[{"id":"wordpress/0","charmUrl":"cs:precise/wordpress-21","service":"wordpress","machine":"1","agent_state":"started","open_ports":[],"clientId":"serviceUnit_45","number":0,"urlName":"wordpress-0","name":"serviceUnit","displayName":"wordpress/0"}],"relations":[{"interface":"mysql","relation_id":"wordpress:db mysql:db","endpoints":[["wordpress",{"role":"client","name":"db"}],["mysql",{"role":"server","name":"db"}]],"pending":false,"scope":"global","display_name":"db:db"}],"relationChangeTrigger":{"error":{}},"upgrade_available":false,"upgrade_to":"cs:undefined","aggregated_status":{"running":1},"packageName":"wordpress","loading":false})
],
machines: [
eval({"id":"0","clientId":"machine_36","name":"machine","displayName":"0","parentId":null,"containerType":null,"number":0,"addresses":[],"instance_id":"fake-instance","agent_state":"started","hardware":{"arch":"amd64","cpuCores":1,"cpuPower":100,"mem":1740,"disk":8192},"jobs":["JobHostUnits"],"life":"alive","series":"precise","supportedContainers":["lxc","kvm"]}),
eval({"id":"1","clientId":"machine_46","name":"machine","displayName":"1","parentId":null,"containerType":null,"number":1,"addresses":[],"instance_id":"fake-instance","agent_state":"started","hardware":{"arch":"amd64","cpuCores":1,"cpuPower":100,"mem":1740,"disk":8192},"jobs":["JobHostUnits"],"life":"alive","series":"precise","supportedContainers":["lxc","kvm"]})
]
}
}
function loadData(data) {
data.charms.forEach(function(charm) {
app.db.charms.add(charm);
app.db.fire('update');
});
data.machines.forEach(function(machine) {
app.db.machines.add(machine);
app.db.fire('update');
});
data.services.forEach(function(service) {
app.db.services.add(service);
app.db.fire('update');
});
data.relations.forEach(function(relation) {
app.db.relations.add(relation);
app.db.fire('update');
});
}
function preload() {
var data = createData();
loadData(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment