VMware vSphere Automation SDK Perl The VMware vSphere Automation SDK for Perl supports the client-side vSphere Automation API for access to vSphere services and capabilities

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions
List of all members
Com::Vmware::Vapi::Bindings::StubFactory Class Reference

## Avaliable Methods
public method | create_stub ()
public method | new ()

## Detailed Description

Factory for the client-side vAPI stubs.

Assumptions:
  None.

Dependencies:
  None.

## Member Function Documentation

public method Com::Vmware::Vapi::Bindings::StubFactory::create_stub | ( |  | ) |

Create a stub corresponding to the specified service name

Parameters

  service_name | - Name of the service
  stub_config | - Stub's additional configuration

Return values

  The stub corresponding to the specified service name | Code: click to view # Number of lines of code in create_stub: 48 sub create_stub { my ( $self, %args ) = @_; my $serviceName = $args{service_name}; my $stubConfig = $args{stub_config}; my $stub = undef; if ( $serviceName->can('new') ) { return $serviceName->new( 'api_provider' => $self->{api_provider}, 'stub_config' => $stubConfig ); } else { my $message_factory = Com::Vmware::Vapi::l10n::Runtime::get_runtime_message_factory(); my $msg = $message_factory->get_message( id => 'Com.Vmware.Vapi.Bindings.StubFactory.ModuleNotLoaded', args => [$serviceName] ); throw ModuleNotLoaded( $msg->str() ); } # # The following code is dead code for now. If we decide to support partial name search, then we # enable the following code # my %hash = %INC; my $key; my $value; while ( ( $key, $value ) = each %INC ) { if ( $key =~ /Com\/Vmware*/ ) { $key =~ s/\//::/g; $key =~ s/.pm/::$serviceName/g; if ( $key->can('new') && $key->isa('Com::Vmware::Vapi::Bindings::VapiInterface') ) { $serviceName = $key; } } } $stub = $serviceName->new( 'api_provider' => $self->{api_provider}, 'stub_config' => $stubConfig ); return $stub; }

public method Com::Vmware::Vapi::Bindings::StubFactory::new | ( |  | ) |

Constructor to initialize the StubFactory object

Parameters

  api_provider | - protocol connection to use with stubs created by this factory

Return values

  Blessed object | Code: click to view # Number of lines of code in new: 7 sub new { my ( $class, %args ) = @_; my $self = {}; $self->{api_provider} = $args{api_provider}; bless( $self, $class ); return ($self); }

The documentation for this class was generated from the following file:

- Com/Vmware/Vapi/Bindings/StubFactory.pm