Webservice::OVH::Cloud::Project::Instance
use Webservice::OVH; my $ovh = Webservice::OVH->new_from_json("credentials.json"); my $projects = $ovh->cloud->projects; my $example_project = $projects->[0]; my $instances = $project->instances; foreach my $instance (@$instances) { print @$instance->status; $instance->delete; }
Access to instace functionality.
Internal Method to create the Network object. This method is not ment to be called directly. This method is used when instance is initialised as a bridge object for static usage.
Parameter: %params - key => value
Return: Webservice::OVH::Cloud::Project::Instance
Synopsis: Webservice::OVH::Cloud::Project::Instance->_new(wrapper => $ovh_api_wrapper, project => $project, module => $module );
Returns 1 if object is available, 0 if not.
Parameter: $group_id - api id, $no_recheck - (optional)only for internal usage
Return: VALUE
Synopsis: print "group exists" if $project->group_exists($id);
Produces an array of all available groups that are connected to the instance.
Return: ARRAY
Synopsis: my $instances = $instance->groups;
Returns a single group by id
Parameter: $group_id - api id
Return: Webservice::OVH::Cloud::Project::Instance::Group
Synopsis: my $instance = $isntance->group($id);
Creates a new group
Parameter: %params - key => value (required) region
Return: <Webservice::OVH::Cloud::Project::Instance::Group>
Synopsis: my $group = $project->create_instance( region => 'GRA1' );
Internal Method to create the Instance object. This method is not ment to be called directly.
Synopsis: Webservice::OVH::Cloud::Project::Instance->_new( wrapper => $ovh_api_wrapper, project => $project, module => $module, id => $id );
Returns the api id
Synopsis: my $id = $instance->id;
When this object is deleted on the api side, this method returns 0.
Synopsis: print "Valid" if $instance->is_valid;
Internal method to check validity. Difference is that this method carps an error.
Synopsis: $instance->_is_valid;
Root Project.
Return: Webservice::OVH::Cloud::Project
Synopsis: my $project = $instance->project;
Returns the raw properties as a hash. This is the original return value of the web-api.
Return: HASH
Synopsis: my $properties = $instance->properties;
Exposed property value.
Synopsis: my $description = $instance->description;
Synopsis: my $status = $instance->status;
Synopsis: my $name = $instance->name;
Synopsis: my $region = $instance->region;
Return: <Webservice::OVH::Cloud::Project::Image>
Synopsis: my $image = $instance->image;
Return: DateTime
Synopsis: my $dt_created = $instance->created;
Return: <Webservice::OVH::Cloud::Project::SSH>
Synopsis: my $ssh_key = $instance->ssh_key;
Synopsis: my $monthly_billing = $instance->monthly_billing;
Synopsis: my $ip_addresses = $instance->ip_addresses;
Synopsis: my $flavor = $instance->flavor;
Changes the instance.
Parameter: $instance_name - instance name
Synopsis: $instance->change('Test Instance');
Deletes the object api sided and sets it invalid.
Synopsis: $instance->delete;
Activates monthly billing for rinstance.
Synopsis: $instance->active_monthly_billing;
Return many statistics about the virtual machine for a given period
Synopsis: $instance->monitoring;
Reboots the instance. Options are soft or hard.
Parameter: $type - soft hard
Synopsis: $instance->reboot;
Reinstall an instance.
Parameter: $image_id - image id
Enable or disable rescue mode.
Parameter: $rescue - enabled or not (true/1), (optional) $image_id - image id
Migrate your instance to another flavor.
Synopsis: $instance->resize($flavor_id);
Snapshot an instance.
Parameter: $snapshotName - Name of the snapshot
Synopsis: $instance->snapshotName("Snapshot1");
Get VNC access to your instance.
Synopsis: $instance->vnc;
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.