def self.data
@data ||= begin
zone_id = Fog.credentials[:cloudstack_zone_id] || Fog::Cloudstack.uuid
image_id = Fog.credentials[:cloudstack_template_id] || Fog::Cloudstack.uuid
flavor_id = Fog.credentials[:cloudstack_service_offering_id] || Fog::Cloudstack.uuid
network_id = (Array(Fog.credentials[:cloudstack_network_ids]) || [Fog::Cloudstack.uuid]).first
domain_name = "exampleorg"
account_id, user_id, domain_id = Fog::Cloudstack.uuid, Fog::Cloudstack.uuid, Fog::Cloudstack.uuid
domain = {
"id" => domain_id,
"name" => domain_name,
"level" => 1,
"parentdomainid" => Fog::Cloudstack.uuid,
"parentdomainname" => "ROOT",
"haschild" => false,
"path" => "ROOT/accountname"
}
user = {
"id" => user_id,
"username" => "username",
"firstname" => "Bob",
"lastname" => "Lastname",
"email" => "email@example.com",
"created" => "2012-05-14T16:25:17-0500",
"state" => "enabled",
"account" => "accountname",
"accounttype" => 2,
"domainid" => domain_id,
"domain" => domain_name,
"apikey" => Fog::Cloudstack.uuid,
"secretkey" => Fog::Cloudstack.uuid
}
{
:users => { user_id => user },
:networks => { network_id => {
"id" => network_id,
"name" => "10.56.23.0/26",
"displaytext" => "10.56.23.0/26",
"broadcastdomaintype" => "Vlan",
"traffictype" => "Guest",
"gateway" => "10.56.23.1",
"netmask" => "255.255.255.192",
"cidr" => "10.56.23.0/26",
"zoneid" => zone_id,
"zonename" => "zone-00",
"networkofferingid" => "af0c9bd5-a1b2-4ad0-bf4b-d6fa9b1b9d5b",
"networkofferingname" => "DefaultSharedNetworkOffering",
"networkofferingdisplaytext" => "Offering for Shared networks",
"networkofferingavailability" => "Optional",
"issystem" => false,
"state" => "Setup",
"related" => "86bbc9fc-d92e-49db-9fdc-296189090017",
"broadcasturi" => "vlan://800",
"dns1" => "10.0.80.11",
"type" => "Shared",
"vlan" => "800",
"acltype" => "Domain",
"subdomainaccess" => true,
"domainid" => domain_id,
"domain" => "ROOT",
"service" => [
{"name" => "UserData"},
{"name" => "Dhcp"},
{
"name" => "Dns",
"capability" => [
{
"name" => "AllowDnsSuffixModification",
"value" => "true",
"canchooseservicecapability" => false
}
]
}],
"networkdomain" => "cs1cloud.internal",
"physicalnetworkid" => "8f4627c5-1fdd-4504-8a92-f61b4e9cb3e3",
"restartrequired" => false,
"specifyipranges" => true}
},
:zones => { zone_id => {
"id" => zone_id,
"name" => "zone-00",
"domainid" => 1,
"domainname" => "ROOT",
"networktype" => "Advanced",
"securitygroupsenabled" => false,
"allocationstate" => "Enabled",
"zonetoken" => Fog::Cloudstack.uuid,
"dhcpprovider" => "VirtualRouter"}},
:images => { image_id => {
"id" => image_id,
"name" => "CentOS 5.6(64-bit) no GUI (XenServer)",
"displaytext" => "CentOS 5.6(64-bit) no GUI (XenServer)",
"ispublic" => true,
"created" => "2012-05-09T15:29:33-0500",
"isready" => true,
"passwordenabled" => false,
"format" => "VHD",
"isfeatured" => true,
"crossZones" => true,
"ostypeid" => "a6a6694a-18f5-4765-8418-2b7a5f37cd0f",
"ostypename" => "CentOS 5.3 (64-bit)",
"account" => "system",
"zoneid" => zone_id,
"zonename" => "zone-00",
"status" => "Download Complete",
"size" => 21474836480,
"templatetype" => "BUILTIN",
"domain" => "ROOT",
"domainid" => "6023b6fe-5bef-4358-bc76-9f4e75afa52f",
"isextractable" => true,
"checksum" => "905cec879afd9c9d22ecc8036131a180",
"hypervisor" => "Xen"
}},
:flavors => { flavor_id => {
"id" => flavor_id,
"name" => "Medium Instance",
"displaytext" => "Medium Instance",
"cpunumber" => 1,
"cpuspeed" => 1000,
"memory" => 1024,
"created" => "2012-05-09T14:48:36-0500",
"storagetype" => "shared",
"offerha" => false,
"limitcpuuse" => false,
"issystem" => false,
"defaultuse" => false}},
:accounts => { account_id => {
"id" => account_id,
"name" => "accountname",
"accounttype" => 2,
"domainid" => domain_id,
"domain" => domain_name,
"receivedbytes" => 0,
"sentbytes" => 0,
"vmlimit" => "Unlimited",
"vmtotal" => 0,
"vmavailable" => "Unlimited",
"iplimit" => "Unlimited",
"iptotal" => 0,
"ipavailable" => "Unlimited",
"volumelimit" => "Unlimited",
"volumetotal" => 0,
"volumeavailable" => "Unlimited",
"snapshotlimit" => "Unlimited",
"snapshottotal" => 0,
"snapshotavailable" => "Unlimited",
"templatelimit" => "Unlimited",
"templatetotal" => 0,
"templateavailable" => "Unlimited",
"vmstopped" => 0,
"vmrunning" => 0,
"projectlimit" => "Unlimited",
"projecttotal" => 1,
"projectavailable" => "Unlimited",
"networklimit" => "Unlimited",
"networktotal" => 0,
"networkavailable" => "Unlimited",
"state" => "enabled",
"user" => [user]}
},
:domains => {domain_id => domain},
:servers => {},
:jobs => {},
:volumes => {},
:security_groups => {},
}
end
end