ALM Site Administration API Type Library 12.50 and later
CreateDomain Method
The domain name.
The contact name.
The contact email.
The user connection number quota. -1 indicates an unlimited number of connections.
Description
Creates a new domain and retrieves the domain properties.
Syntax
Visual Basic
Public Function CreateDomain( _
   ByVal DomainName As String, _
   ByVal ContactName As String, _
   ByVal ContactEmail As String, _
   ByVal UserQuota As Long _
) As String
Parameters
DomainName
The domain name.
ContactName
The contact name.
ContactEmail
The contact email.
UserQuota
The user connection number quota. -1 indicates an unlimited number of connections.
Return Type

On success, returns an XML string containing the domain properties.

Return Value Details
The properties of the CreateDomain XML return string:

Return Value Example
<CreateDomain>
    <DOMAIN_ID>20</DOMAIN_ID>
    <DOMAIN_NAME>TEST2</DOMAIN_NAME>
    <PASSWORD />
    <ADMIN_PASSWORD />
    <PHYSICAL_DIRECTORY>C:\TD_Dir\TEST2\</PHYSICAL_DIRECTORY>
    <COMPANY_NAME />
    <CONTACT_NAME>david</CONTACT_NAME>
    <CONTACT_EMAIL>davidp@mercury</CONTACT_EMAIL>
    <USERS_QUOTA>20</USERS_QUOTA>
    <DEFECTS_QUOTA>100000</DEFECTS_QUOTA>
    <PROJECTS_QUOTA>30</PROJECTS_QUOTA>
    <FILESYSTEM_QUOTA>51200</FILESYSTEM_QUOTA>
    <PROJECTS_LIST/>
    <USERS_VERSION>0</USERS_VERSION>
</CreateDomain>
Example
Private Sub CreateDomain()

'The following Visual Basic example creates a new domain.

    Dim sDomainName As String
    Dim sContactName As String
    Dim sContactEmail As String
    Dim sReply As String

    On Error GoTo err
    sDomainName = "MyNewDomain"
    sContactName = "" 'Generally not in use
    sContactEmail = "" 'Generally not in use

    sReply = m_SAClient.CreateDomain _
        (sDomainName, sContactName, sContactEmail, 500)
    MsgBox sReply
    Exit Sub

err:
    MsgBox "Program failed:" + err.Description

End Sub
See Also

SAapi Object  | SAapi Members