NCC Platform Data Functions

Overview

The NCC API can be used to retrieve information about the configured platform for use within your scripts.

All platform information is cached (among all calls) for 300 seconds within the Lua runtime.


Functions


ncc.customers ()
  Parameters None.  
  Returns A (possibly empty) table of ACS customers (service providers), formatted as:

{
    <ACS_CUSTOMER.ID> = {
        NAME = <ACS_CUSTOMER.NAME>
        ID = <ACS_CUSTOMER.ID>
    },
    <ACS_CUSTOMER.ID> = {...}
}

  Errors If the retrieved customers are not able to be turned into a table, the following error will be raised:

Retrieved customers are not readable.

Usage This function queries the Lua runtime and extracts the available ACS customers, returning the data in a table of values.

local customers = ncc.customers ()
for k, v in pairs (customers) do
    ncc.debug ("ACS service provider: " .. v.NAME .. ", ID " .. k)
end

This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.


ncc.customer_id_for_name (acs_customer_name)
  Parameters acs_customer_name The name of the ACS customer to retrieve the ID for.
  Returns The ID of the ACS customer that has the name provided, or nil if no match was found.
  Errors None.
Usage This function offers a helper lookup on the ACS customer data on the NCC system. It calls the ncc.customers function and then searches for the customer name provided, returning the customer ID if found. If the customer is not found, nil is returned.

ncc.debug ("The Boss service provider ID is " .. ncc.customer_id_for_name ('Boss') .. ".")


ncc.customer_name_for_id (acs_customer_id)
  Parameters acs_customer_id The ID of the ACS customer to retrieve the name for.
  Returns The name of the ACS customer that has the ID provided, or nil if no match was found.
  Errors None.
Usage This function offers a helper lookup on the ACS customer data on the NCC system. It calls the ncc.customers function and then searches for the customer ID provided, returning the customer name if found. If the customer is not found, nil is returned.

ncc.debug ("Customer ID 123 has the name " .. ncc.customer_name_for_id (123) .. ".")


ncc.profile.tags ()
  Parameters None.  
  Returns A (possibly empty) table of ACS profile tags, formatted as:

{
    <ACS_PROFILE_DETAILS.PROFILE_TAG> = {
        NAME = <ACS_PROFILE_DETAILS.PROFILE_TAG.NAME>
        TAG = <ACS_PROFILE_DETAILS.PROFILE_TAG>
        TYPE = <ACS_PROFILE_DETAILS.PROFILE_TAG.TYPE>
        PARENT = <ACS_PROFILE_DETAILS.PARENT_PROFILE_TAG>
    },
    <ACS_PROFILE_DETAILS.PROFILE_TAG> = {...}
}

  Errors If the retrieved profile tags are not able to be turned into a table, the following error will be raised:

Retrieved profile tags are not readable.

Usage This function queries the Lua runtime and extracts all profile tag definitions, returning it in a table of values.

local tags = ncc.profile.tags ()
for k, v in pairs (tags) do
    ncc.debug ("Profile tag " .. k .. " is of type " .. v.TYPE)
end

This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.


ncc.profile.get_tag_by_name (profile_tag_name)
  Parameters profile_tag_name The name of the profile tag to retrieve.
  Returns Either nil if no match is found, or a table for a single ACS profile tag, formatted as:

{
    NAME = <ACS_PROFILE_DETAILS.PROFILE_TAG.NAME>
    TAG = <ACS_PROFILE_DETAILS.PROFILE_TAG>
    TYPE = <ACS_PROFILE_DETAILS.PROFILE_TAG.TYPE>
    PARENT = <ACS_PROFILE_DETAILS.PARENT_PROFILE_TAG>
}

  Errors None.
Usage This function offers a helper lookup on the profile tag definitions on the NCC system. It calls the ncc.profile.tags function and then searches for the profile tag name provided, returning the profile tag details if found. If the profile tag is not found, nil is returned.

local fail_tag = ncc.profile.get_tag_by_name ("Account Lookup Failure")

if (ncc.profile.read_int ("TEMPORARY", fail_tag.TAG)) then
    -- account lookup failed


ncc.profile.get_tag_by_tag (profile_tag)
  Parameters profile_tag The tag value of the profile tag to retrieve.
  Returns Either nil if no match is found, or a table for a single ACS profile tag, formatted as:

{
    NAME = <ACS_PROFILE_DETAILS.PROFILE_TAG.NAME>
    TAG = <ACS_PROFILE_DETAILS.PROFILE_TAG>
    TYPE = <ACS_PROFILE_DETAILS.PROFILE_TAG.TYPE>
    PARENT = <ACS_PROFILE_DETAILS.PARENT_PROFILE_TAG>
}

  Errors None.
Usage This function offers a helper lookup on the profile tag definitions on the NCC system. It calls the ncc.profile.tags function and then searches for the profile tag provided, returning the profile tag details if found. If the profile tag is not found, nil is returned.

local mmx_class = ncc.profile.get_tag_by_tag (3932473)
ncc.debug (mmx_class.NAME)


ncc.profile.tag_for_name (profile_tag_name)
  Parameters profile_tag_name The name of the profile tag to retrieve the tag value for.
  Returns The tag value of the profile that has the name provided, or nil if no match was found.
  Errors None.
Usage This is a specialised shortcut version of ncc.profile.get_tag_by_name that returns only the tag value of the name provided. If the profile tag is not found, nil is returned.

local hour_tag = ncc.profile.tag_for_name ('CC Current Time Hour') -- 327807


ncc.profile.tag_name_for_id (profile_tag)
  Parameters profile_tag The tag value of the profile tag to retrieve the name for.
  Returns The name of the profile tag that has the tag value provided, or nil if no match was found.
  Errors None.
Usage This is a specialised shortcut version of ncc.profile.get_tag_by_tag that returns only the name of the profile tag provided. If the profile tag is not found, nil is returned.

local hour_tag_name = ncc.profile.name_for_tag (327807) -- 'CC Current Time Hour'