Webservice::OVH::Cloud::Project
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;
Provides access to all sub objects of a specific projects.
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);
Returns the api id
Return: VALUE
Synopsis: my $id = $project->id;
Returns the raw properties as a hash. This is the original return value of the web-api.
Return: HASH
Synopsis: my $properties = $project->properties;
Exposed property value.
Synopsis: my $description = $project->description;
Synopsis: my $sub_domain = $project->unleash;
Return: <Webservice::OVH::Me::Order>
Synopsis: my $order = $project->order;
Synopsis: my $status = $project->status;
Synopsis: my $access = $project->access;
Changes the project.
Parameter: %params - key => value description
Synopsis: $project->change(description => 'Beschreibung');
Get associated vrack.
Synopsis: $project->vrack;
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
Synopsis: print "instance exists" if $project->instance_exists($id);
Produces an array of all available instances that are connected to the project.
Return: ARRAY
Synopsis: my $instances = $project->instances;
Returns a single instance by id
Parameter: $instance_id - api id
Return: Webservice::OVH::Cloud::Project::Instance
Synopsis: my $instance = $project->instance($id);
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 } ] );
Simple list of all available regions
Synopsis: my $regions = $project->regions;
Get additional info about a specific region
Synopsis: my $region_info = $project->region('GRA1');
Returns a hash of all available flavors.
Synopsis: my $flavors = $project->flavors;
Returns info about a specific flavor by id.
Returns 1 if image is available for the project, 0 if not.
Parameter: $image_id - api id, $no_recheck - (optional)only for internal usage
Synopsis: print "image exists" if $project->image_exists(1234);
Produces an array of all available images that are connected to the project.
Parameter: %filter - key => value flavor_type os_type region
Synopsis: my $images = $project->images( flavor_type => 'ovh.ssd.eg', os_type => 'linux', region => 'GRA1' );
Returns a single image by id
Parameter: $image_id - api id
Return: Webservice::OVH::Cloud::Project::Image
Synopsis: my $image = $project->image($id);
Returns 1 if key is available for the project, 0 if not.
Parameter: $key_id - api id, $no_recheck - (optional)only for internal usage
Produces an array of all available ssh_keys that are connected to the project.
Parameter: $region - filters for specific region
Synopsis: my $keys = $project->images( region => 'GRA1' );
Returns a single ssh_key by id
Parameter: $key_id - api id
Return: Webservice::OVH::Cloud::Project::SSH
Synopsis: my $ssh_key = $project->ssh_key($id);
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 );
Access to /cloud/project/network api methods
Return: Webservice::OVH::Cloud::Project::Network
Synopsis: $project->network;
Access to /cloud/project/ip api methods
Return: Webservice::OVH::Cloud::Project::IP
Synopsis: $project->ip;
To install Webservice::OVH, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Webservice::OVH
CPAN shell
perl -MCPAN -e shell install Webservice::OVH
For more information on module installation, please visit the detailed CPAN module installation guide.