NAME
Webservice::OVH::Cloud::Project
SYNOPSIS
use Webservice::OVH;
my $ovh = Webservice::OVH->new_from_json("credentials.json");
my $projects = $ovh->cloud->projects;
my $example_project = $projects->[0];
my $images = $project->images;
my $instances = $project->instances;
my $regions = $project->regions;
my $flavors = $project->flavors;
my $ssh_keys = $project->ssh_keys;
my $networks = $project->network->privates;
DESCRIPTION
Provides access to all sub objects of a specific projects.
METHODS
_new_existing
Internal Method to create the project object. This method is not ment to be called directly.
Parameter: $api_wrapper - ovh api wrapper object, $module - root object, $id - api id
Return: Webservice::OVH::Cloud::Project
Synopsis: Webservice::OVH::Cloud::Project->_new($ovh_api_wrapper, $project_name, $module);
id
Returns the api id
Return: VALUE
Synopsis: my $id = $project->id;
properties
Returns the raw properties as a hash. This is the original return value of the web-api.
Return: HASH
Synopsis: my $properties = $project->properties;
description
Exposed property value.
Return: VALUE
Synopsis: my $description = $project->description;
unleash
Exposed property value.
Return: VALUE
Synopsis: my $sub_domain = $project->unleash;
order
Exposed property value.
Return: <Webservice::OVH::Me::Order>
Synopsis: my $order = $project->order;
status
Exposed property value.
Return: VALUE
Synopsis: my $status = $project->status;
access
Exposed property value.
Return: VALUE
Synopsis: my $access = $project->access;
change
Changes the project.
Parameter: %params - key => value description
Synopsis: $project->change(description => 'Beschreibung');
vrack
Get associated vrack.
Return: HASH
Synopsis: $project->vrack;
instance_exists
Returns 1 if object is available for the connected account, 0 if not.
Parameter: $instance_id - api id, $no_recheck - (optional)only for internal usage
Return: VALUE
Synopsis: print "instance exists" if $project->instance_exists($id);
instances
Produces an array of all available instances that are connected to the project.
Return: ARRAY
Synopsis: my $instances = $project->instances;
instance
Returns a single instance by id
Parameter: $instance_id - api id
Synopsis: my $instance = $project->instance($id);
create_instance
Creates a new instance. Flavor image and ssh key need to be fetched first. There is an example in examples/cloud.pl
Parameter: %params - key => value (required) flavor_id image_id name region (optional) group_id monthly_billing ssh_key_id user_data networks
Return: <Webservice::OVH::Cloud::Project::Instance>
Synopsis: my $instance = $project->create_instance(flavor_id => $flavor->id, image_id => $image->id, name => 'test', region => 'GRA1', ssh_key => $key->id networks => [ {ip => '0.0.0.0', network_id => 1 }, {ip => '0.0.0.0', network_id => 2 } ] );
regions
Simple list of all available regions
Return: ARRAY
Synopsis: my $regions = $project->regions;
regions
Get additional info about a specific region
Return: HASH
Synopsis: my $region_info = $project->region('GRA1');
flavors
Returns a hash of all available flavors.
Return: ARRAY
Synopsis: my $flavors = $project->flavors;
flavor
Returns info about a specific flavor by id.
Return: HASH
Synopsis: my $flavors = $project->flavors;
image_exists
Returns 1 if image is available for the project, 0 if not.
Parameter: $image_id - api id, $no_recheck - (optional)only for internal usage
Return: VALUE
Synopsis: print "image exists" if $project->image_exists(1234);
images
Produces an array of all available images that are connected to the project.
Parameter: %filter - key => value flavor_type os_type region
Return: ARRAY
Synopsis: my $images = $project->images( flavor_type => 'ovh.ssd.eg', os_type => 'linux', region => 'GRA1' );
image
Returns a single image by id
Parameter: $image_id - api id
Synopsis: my $image = $project->image($id);
ssh_key_exists
Returns 1 if key is available for the project, 0 if not.
Parameter: $key_id - api id, $no_recheck - (optional)only for internal usage
Return: VALUE
Synopsis: print "image exists" if $project->image_exists(1234);
ssh_keys
Produces an array of all available ssh_keys that are connected to the project.
Parameter: $region - filters for specific region
Return: ARRAY
Synopsis: my $keys = $project->images( region => 'GRA1' );
ssh_key
Returns a single ssh_key by id
Parameter: $key_id - api id
Synopsis: my $ssh_key = $project->ssh_key($id);
create_ssh_key
Creates a new ssh key.
Parameter: %params - key => value (required) name public_key (optional) region
Return: <Webservice::OVH::Cloud::Project::SSH>
Synopsis: my $ssh_key = $project->create_ssh_key( name => 'Test key', public_key => $key );
network
Access to /cloud/project/network api methods
Synopsis: $project->network;
ip
Access to /cloud/project/ip api methods
Synopsis: $project->ip;