Skip to content

Instantly share code, notes, and snippets.

private List<ServiceOfferingVO> searchServiceOfferingsInternal(Account caller, Object name, Object id, Long vmId, Object keyword, Filter searchFilter) {
// it was decided to return all offerings for the user's domain, and everything above till root (for normal user
// or
// domain admin)
// list all offerings belonging to this domain, and all of its parents
// check the parent, if not null, add offerings for that parent to list
List<ServiceOfferingVO> sol = new ArrayList<ServiceOfferingVO>();
DomainVO domainRecord = _domainDao.findById(caller.getDomainId());
boolean includePublicOfferings = true;
@app.route('/' + app.config['PATH'] + '<projectid>/aggregated/instances', methods=['GET'])
@authentication.required
def aggregatedlistinstances(projectid, authorization):
zonelist = zones.get_zone_names(authorization)
instancesList = _get_instances(authorization)
items = {}
for zone in zonelist:
zones_instances = []
if instancesList['listvirtualmachinesresponse']:
@app.route('/' + app.config['PATH'] + '<projectid>/zones/<zone>/instances', methods=['GET'])
@authentication.required
def listinstances(projectid, authorization, zone):
cloudstack_response = _get_instances(authorization)
items = []
if cloudstack_response['listvirtualmachinesresponse']:
for instance in cloudstack_response['listvirtualmachinesresponse']['virtualmachine']:
items.append(_cloudstack_instance_to_gce(instance))
def filter_by_name(data, name):
for item in data:
if item['name'] == name:
return item
return None
duffy at thunder in ~/bin/gcutilexo
$ ./gcutil --authorization_uri_base=https://localhost:5000/oauth2 --auth_host_name=127.0.0.1 --auth_host_port=9999 --auth_local_webserver=true --api_host="https://localhost:5000/" --ssh_user=root --fetch_discovery=true [email protected] addinstance example71
Selecting the only available zone: CH-GV2
1: Extra-large Extra-large 16384mb 4cpu
2: Huge Huge 32184mb 8cpu
3: Large Large 8192mb 4cpu
4: Medium Medium 4096mb 2cpu
5: Micro Micro 512mb 1cpu
6: Small Small 2048mb 2cpu
7: Tiny Tiny 1024mb 1cpu

Introduction

This document contains the design specifications for gCloud, a Google Compute Engine(GCE) like API front end For Apache CLoudstack.

Purpose

gCloud supplies a layer ontop of the Apache Cloudstack API. The purpose of this layer is to expose a Google Compute Engine(GCE) like API for Cloudstack.

gCloud will accept GCE based API calls, translate and pass them over to the Apache Cloudstack API, parse the response and return it in a suitable GCE format.

.............................
.............................
.............................
.............................
informationWithinLdap:{
password: {
label: 'label.password',
validation: {
required: true
@imduffy15
imduffy15 / LargestFromTextFile.java
Created October 12, 2013 18:42
Find largest number in a text file with java
import java.io.*;
import java.util.*;
class LargestFromTextFile {
public static void main(String[] args) {
try {
Scanner file = new Scanner(new File("numbers.txt"));
int largest = file.nextInt();
while(file.hasNextInt()) {
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
# Screenshot: http://i.imgur.com/s0Blh.png
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
/**
* The following program is based of the first CA213 continuous exam.
* It is wrote from memory so it may have a few errors, but it is mostly
* the same.
*
* The exam required you to:
* 1) Create a interface Printable with method put.
* 2) Modify the given Date class to implement Printable and to have a put
* method
* 3) Create a program, PastDates which reads in dates from the console. Stores