Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Automatics API can be created using following two custom annotations:

...

    1. @AutomaticsApi - Used to declare

...

    1. Automatics API
    2. @AutomaticsApiParam - Used to declare Automatics API Parameters

Below is the example which showcase the code of Automatics API.

@AutomaticsApi(category = AutomaticsApiCategory.

SELF

TUNE_

PROTECT_RDKB

CHANNEL,

applicablefor

applicableFor =

 "RDKB"

{
        ApplicableFor.RDKV, }, description =

 "Purpose: To turn the web power switch on for given device name.How it works: It fetches the power outlet for the given device name from dynamoDB and turns the web power switch on.Return value: Status code and response string.

"Tune to particular IP channel", name =

 

"

POWER_ON

TUNE_TO_PARTICULAR_IPCHANNEL", returntype =

 

"String")
    public

 

static

 String powerOn(param1,
        

ResponseObject tuneToAnIpChannelAndCheckAV(AutomaticsTapApi tapEnv, Dut device,
        @AutomaticsApiParam(name =

 

"

deviceName"String specify the name of device", example = "touchscreen") param2, ..)

channelNo", description

= 

= "Channel Number", defaultOptions = "120,121") String channel No,
        @AutomaticsApiParam(name = "streamType", description = "Stream Type", defaultOptions = "HD, SD") String stream Type) {


{
    //code to perform
}

...

    1. @AutomaticsApi: It

...

    1. 's a custom annotation need to be written at the very beginning of the function definition as shown in example.

...

    1. So, whenever an API is called the below defined function will be executed. This annotation takes below mentioned parameter values:

...

      1.  category: Automatics API category for which the API is created.

...

      1.  applicable for: For which environment the API is applicable, such as RDKB, RDKC, RDKV.

      2.  description: A short description of what the API actually does.

      3.  name: Name of the API. Whatever name is defined over here will be seen as the API name in the Automatics UI under the available method section during TC automation.

      4.  returntype: Datatype of the response which is going to be returned by the API.

...

    1. @AutomaticsApiParam: It's a custom annotation using which we can take a parameter value from user from the automatics UI.
      This annotation takes below mentioned parameter values:
      1. description: A short description of what this parameter is used for.

      2. name: Name of the parameter. Whatever name is defined over here will be seen as the API parameter with an input box in the input configuration of the API.

...

      1. default options: It will be seen as a value suggestion in the input box of the parameter. Multiple values can be added using comma.

...

  1. Open relatable URL.
    1. Development branch: https://rdkauto14.ccp.xcal.tv:8443/view/AUTOMATICS%20UTILS%20DEPLOYMENT/job/DEPLOY-AUTOMATICS-UTILS-DEV/
    2. stable branch: https://rdkauto14.ccp.xcal.tv:8443/view/AUTOMATICS%20UTILS%20DEPLOYMENT/job/DEPLOY-AUTOMATICS-UTILS-PROD
  2. Click on "Build with parameters"
  3. Select "RDKB-UTILS" as profile.
  4. Click on "Build" button.

...

  • Once the API development is done changes need be merged.