OV_Service::Create()
OV_Service::Create_Trans()
- OV_Service Create(
- [in] string Caption,
- [in] string ServiceTypeId,
- [in, optional] sint32 HostingType,
- [in, optional] string HostedOnName,
- [in, optional] string ParentName,
- [in, optional] string Name,
- [in, optional] string Description,
- [in, optional] string Attributes[] )
- OV_Service Create_Trans(
- [in] string TransId,
- [in] string Caption,
- [in] string ServiceTypeId,
- [in, optional] sint32 HostingType,
- [in, optional] string HostedOnName,
- [in, optional] string ParentName,
- [in, optional] string Name,
- [in, optional] string Description,
- [in, optional] string Attributes[] )
Parameters
- TransId
- Transaction ID returned from OV_Transaction::Start().
- Caption
- The Caption property of the instance of OV_Service to be
created. If a service with the same Caption already exists on the
same hierarchy path level (as a child of the same parent), nothing
happens, and the method fails with
MDLAPI_E_SERVICE_HIERPATH_EXISTS. If the Caption parameter is an
empty string, contains invalid characters, or has more then 1024
characters, the method fails with MDLAPI_E_INVALID_CAPTION.
- ServiceTypeId
- The GUID property of the instance of OV_ServiceTypeDefinition.
Service type can be only one of the service types that have
child-parent relationships with the service type of the parent
service. If the specified service type cannot be assigned to newly
created service, the method fails with
MDLAPI_E_SERVICETYPE_NOT_VALID.
- HostingType
- Sets the service hosting type. The service can be virtual (0),
hosted on a node (1), or hosted on a node group (2). Optional
parameter. Default is virtual service (0). If this parameter has an
invalid value, the method fails with
MDLAPI_E_INVALID_PARAMETER.
- HostedOnName
- The Name property of the node or node group where this service
is hosted. Optional parameter. This parameter is used only if the
HostingType parameter is set to 1 or 2. If the specified node or
node group does not exist, the method fails with
MDLAPI_E_NODE_NOT_EXIST or MDLAPI_E_NODEGROUP_NOT_EXIST.
- ParentName
- The Name property of the instance of OV_Service to which the
newly created service is added. Optional parameter. If you do not
specify this parameter, or if it is equal to an empty string, the
root service is used. If the specified parent service does not
exist, the method fails with MDLAPI_E_PARENT_SERVICE_NOT_EXIST. If
the specified parent service is the current parent service, the
method fails with MDLAPI_E_SERVICE_IS_ALREADY_PARENT.
- Name
- The Name property of the instance of OV_Service to be created.
Optional parameter. If you do not specify this parameter, or if it
is equal to an empty string, it is created as a new GUID. If a
Service with the same Name already exists, nothing happens, and the
method fails with MDLAPI_E_SERVICE_NAME_EXISTS.
- Description
- The Description property of the instance of OV_Service to be
created. Optional parameter.
- Attributes
- The Attributes array property of the instance of OV_Service to
be created. Optional parameter.
Calling Convention
These methods can be called from a WMI class or instance
object.
Description
Creates a service (new instance of OV_Service).
Calculation and propagation rules are inherited from the service
type specified with the ServiceTypeId parameter. If any of these
properties are missing, nothing happens, and the method fails with
MDLAPI_E_INVALID_PROPERTY. Default value for the message weight
factor is 1.
Return Value
Instance of the newly created OV_Service.
Extended Status Codes
- MDLAPI_E_INVALID_CAPTION
- Specified object Caption parameter is not valid.
- MDLAPI_E_SERVICE_HIERPATH_EXISTS
- Service with the same Caption is already a child of the parent
service.
- MDLAPI_E_PARENT_SERVICE_NOT_EXIST
- Parent Service does not exist.
- MDLAPI_E_SERVICETYPE_NOT_VALID
- Service type is not valid.
- MDLAPI_E_SERVICE_NAME_EXISTS
- Service with the same Name already exists.
- MDLAPI_E_SVC_TYPE_COMP_ASSOC_NOT_EXIST
- Service type composition does not exist.
- MDLAPI_E_SERVICE_IS_ALREADY_PARENT
- Service already has a parent with the same Name.
- MDLAPI_E_NODE_NOT_EXIST
- Node does not exist.
- MDLAPI_E_NODEGROUP_NOT_EXIST
- Node Group does not exist.
- MDLAPI_E_INVALID_PROPERTY
- Property is not valid.
- MDLAPI_E_TRANSACTION_NOT_EXIST
- Transaction with the specified ID does not exist.