ALM Site Administration API Type Library
CreateDomain Method
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:

  • DOMAIN_ID    -    The domain ID.
  • DOMAIN_NAME    -    The domain name.
  • PASSWORD    -    Not in use.
  • ADMIN_PASSWORD    -    Not in use.
  • PHYSICAL_DIRECTORY    -    The physical directory of the domain.
  • COMPANY_NAME    -    The company name. (Not used by ALM.)
  • CONTACT_NAME    -    The contact name. (Not used by ALM.)
  • CONTACT_EMAIL    -    The contact email. (Not used by ALM.)
  • USERS_QUOTA    -    The maximum number of concurrent connections in all projects of the domain. -1 indicates an unlimited number of connections.
  • DEFECTS_QUOTA    -    Not in use.
  • PROJECTS_QUOTA    -    Not in use.
  • FILESYSTEM_QUOTA    -    Not in use.
  • USERS_VERSION    -    Not in use.
  • PROJECTS_LIST    -    The domain projects are in this list. (This list is always empty when creating a domain.)
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