Manage Applications
    • PDF

    Manage Applications

    • PDF

    Article summary

    You can use the following Britive API methods to manage applications and perform relevant operations. These include creating new applications, getting details of all applications, updating or deleting applications, and enabling or disabling applications.


    1. Details of Applications

    The GET method fetches details of all applications in the system.  If you pass the parameter "view=extended" in the request, it returns additional details of the applications.

    GET
    {{url}}/api/apps

    Request Example

    An example GET request for retrieving application details is shown here:

    curl --location --request GET '{{url}}/api/apps' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    An example response of the GET request for retrieving application details is shown here:

    Status: 200 OK
    [
      {
        "tenantId": null,
        "catalogAppId": 2,
        "status": "active",
        "hasValidPaps": null,
        "catalogAppDisplayName": "GCP",
        "deleted": null,
        "deletedBy": null,
        "allEnvironmentGroupMap": {
         .................................
         ...........
         "rootEnvironmentGroup": {
          "environmentGroups": [
            {
              "name": "britive-gdev.net",
              "description": null,
              "id": "951817868444",
              "parentId": "",
              "nativeId": "951817868444",
              "nativeParentId": "",
              "childGroupIds": [
            .................................
            ...........
            "childEnvironmentIds": [
            .................................
            ...........
            "type": "organizations",
            "internalParentId": ""
           },
           {
            .................................
            ...........
        ],
          "environments": [
            {
              "id": "integration-project-1",
              "name": "Integration Project 1",
              "description": null,
              "parentGroupId": "242725670726",
              "type": "projects",
              "internalParentId": "242725670726"
            },
            {
            .................................
            ...........
         ]
        },
        "catalogApplication": {
         .................................
         ...........
        "catalogAppName": "GCP",
        "catalogAppVersion": "2.0",
        "iconUrl": "/images/app_logos/google-cloud-platform-logo.png",
        "appContainerId": "pUSE0xLks2zke36L9f36",
        "userAccountMappings": []
        },
        {
        "tenantId": null,
        "catalogAppId": 3,
        "status": "active",
        "hasValidPaps": null,
        "catalogAppDisplayName": "Azure",
        "deleted": null,
        "deletedBy": null,
        "allEnvironmentGroupMap": {
         .................................
         ...........     
       },
       {.....}    
    ]

    2. Create a New Application

    The POST method creates a new application.  

    POST{{url}}/api/apps

    Request Example

    An example POST request for creating a new application is shown here.

    curl --location --request POST '{{url}}/api/apps' \
    --header 'Authorization: TOKEN {{token}}' \
    --data-raw '{
    "catalogAppId": 1,
    "catalogAppDisplayName": "AWS-1003"}'

    Response Example 

    An example response of the POST request for creating a new application is shown here.

    Status: 201 Created
    {
      "tenantId": null,
      "catalogAppId": 1,
      "status": "active",
      "hasValidPaps": null,
      "catalogAppDisplayName": "AWS-1004",
      "deleted": null,
      "deletedBy": null,
      "allEnvironmentGroupMap": {},
      "rootEnvironmentGroup": null,
      "catalogApplication": {
        "catalogAppId": 1,
        "key": "AWS-2.0",
        "name": "AWS",
        "version": "2.0",
        "status": "active",
        "description": "Amazon Web Services",
        "propertyTypes": [
          {
            "type": "java.lang.String",
            "enumType": null,
            "enumValues": [],
            "name": "iconUrl",
            "description": "The App's Icon URL Path",
            "required": true,
            "value": "/images/app_logos/aws.png",
            "global": false,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          },
          {
            "type": "java.lang.Enum",
            "enumType": "com.britive.pab.api.AppAccessMethodEnum",
            "enumValues": [
              "samlMethod"
            ],
            "name": "appAccessMethod",
            "description": "Application Access Method",
            "required": true,
            "value": "samlMethod",
            "global": true,
            "privy": false,
            "enumNameMap": {
              "nativeMethod": "Native",
              "samlMethod": "SAML SSO",
              "staticMethod": "Static"
            },
            "readOnly": false
          },
          {
            "type": "java.lang.Integer",
            "enumType": null,
            "enumValues": [],
            "name": "sessionDuration",
            "description": "Duration of the backend AWS connection (in hours)",
            "required": true,
            "value": "1",
            "global": true,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          },
          {
            "type": "java.lang.String",
            "enumType": null,
            "enumValues": [],
            "name": "identityProvider",
            "description": "Identity Provider Name",
            "required": true,
            "value": "Britive",
            "global": true,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          },
          {
            "type": "java.lang.String",
            "enumType": null,
            "enumValues": [],
            "name": "roleName",
            "description": "Integration Role Name",
            "required": true,
            "value": "britive-integration-role",
            "global": true,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          },
          {
            "type": "java.lang.Boolean",
            "enumType": null,
            "enumValues": [],
            "name": "showAwsAccountNumber",
            "description": "Show AWS Account Numbers",
            "required": true,
            "value": false,
            "global": true,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          },
          {
            "type": "java.lang.String",
            "enumType": null,
            "enumValues": [],
            "name": "displayName",
            "description": "Application Name",
            "required": true,
            "value": "AWS-1004",
            "global": false,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          },
          {
            "type": "java.lang.String",
            "enumType": null,
            "enumValues": [],
            "name": "description",
            "description": "Application Description",
            "required": true,
            "value": null,
            "global": false,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          },
          {
            "type": "java.lang.String",
            "enumType": null,
            "enumValues": [],
            "name": "accountId",
            "description": "Master Account ID",
            "required": true,
            "value": "",
            "global": false,
            "privy": false,
            "enumNameMap": null,
            "readOnly": false
          }
        ],
        "uiSettings": {
          "sections": [
            {
              "displayName": "Application",
              "properties": [
                "displayName",
                "description",
                "showAwsAccountNumber"
              ]
            },
            {
              "displayName": "Settings",
              "groups": [
                {
                  "displayName": "Access Methods",
                  "properties": [
                    "appAccessMethod"
                  ]
                },
                {
                  "displayName": "Connection Properties",
                  "properties": [
                    "accountId",
                    "identityProvider",
                    "roleName",
                    "sessionDuration"
                  ]
                }
              ]
            }
          ]
        },
        "requiresAccountMapping": false,
        "supportedPermissionTypes": {
          "Role": "false",
          "Policy": "false",
          "Group": "false"
        },
        "supportsEnvironmentScanning": true,
        "papExpirationSettings": {
          "minimumSessionTime": 900,
          "maximumSessionTime": 43200,
          "supportsSessionExtension": false,
          "numberOfSessionExtensionsAllowed": 0,
          "sessionTimeDuringExtension": 1800
        },
        "supportsTokens": true,
        "requiresHierarchicalModel": false,
        "supportsResources": false,
        "supportsAutoRegistration": false,
        "allowAssociationsInProfiles": true,
        "allowServiceIdentitiesInProfiles": true
      },
      "catalogAppName": "AWS",
      "catalogAppVersion": "2.0",
      "iconUrl": "/images/app_logos/aws.png",
      "appContainerId": "gd36nutxv9r2xy1oykj7",
      "userAccountMappings": []
    }
    

    Note:

    In each POST request, the application name should be unique. 

    For instance, in the preceding request example, the value of catalogAppDisplayName should be unique for each request. That is, in the request body shown in the following code, “AWS-1007” can be used only once in adding an application.

    {    "catalogAppId": 1,     "catalogAppDisplayName": "AWS-1007" }

    The next time, you need to use a different value for catalogAppDisplayName. Else the request fails to return the error “400 bad request”.


    3. Update Application Properties

    The PATCH method helps in making partial changes (updates) to existing applications like updating application properties.

    PATCH{{url}}/api/apps/{{appID}}/properties

    Request Example

    An example PATCH request for updating application properties is shown here:

    curl --location --request PATCH '{{url}}/api/apps/{{appID}}/properties' \
    --header 'Authorization: TOKEN {{token}}' \
    --data-raw '{
        "propertyTypes": [
            {
                "name": "appAccessMethod",
                "value": "samlMethod",
                "defaultValue": "samlMethod"
            },
            {
                "name": "accountId",
                "value": "378563640942",
                "defaultValue": "378563640942"
            }
        ]
    }'

    Response Example

    An example response of the PATCH request for updating application properties is shown here:

    Status: 200 OK
    {
      "tenantId": null,
      "catalogAppId": 1,
      "status": "active",
      "hasValidPaps": null,
      "catalogAppDisplayName": "AWS-1009",
      "deleted": null,
      "deletedBy": null,
      "catalogAppName": "AWS",
      "rootEnvironmentGroup": null,
      "allEnvironmentGroupMap": {},
      "catalogAppVersion": "2.0",
      "iconUrl": "/images/app_logos/aws.png",
      "appContainerId": "paiktfd4q9qtugzmqqln",
      "userAccountMappings": []
    }

    4. Test Applications

    The GET method is used to test applications. This operation performs configuration checks to ensure that the application is correctly configured.

    GET
    {{url}}/api/apps/{{appID}}/test

    Request Example

    An example GET request for testing applications is shown here:

    curl --location --request GET '{{url}}/api/apps/{{appID}}/test'\\
    --header 'Authorization: TOKEN {{token}}''

    Response Example

    If the testing is successful, the GET method returns the following response:

    Status: 200 OK
    {
      "success": true,
      "message": ""
    }

    Error Messages

    If the testing is not successful, an error response is returned. 

    1) If the request ARN is not valid, the following response is displayed.

    {
      "success": false,
      "message": "Request ARN is invalid "
    }

    2) If the STS is not activated, the following response is displayed.

    {
        "success": false,
        "message": "STS is not activated in this region for account:378563640942. Your account administrator can activate STS in this region using the IAM Console. "
    }

    5. Delete an Application

    The DELETE method deletes the application.

    DELETE{{url}}/api/apps?appContainerId={{appID1}}

    Request Example

    An example DELETE request for deleting an application is shown here:

    curl --location --request DELETE '{{url}}/api/apps?appContainerId={{appID}}' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example

    There is no specific response to the DELETE request. It just deletes the application.


    6. Enable Application

    The PATCH method enables an application.

    PATCH
    {{url}}/api/apps/{{appID}}

    Request Example

    An example PATCH request for enabling an application is shown here:

    curl --location --request PATCH '{{url}}/api/apps/{{appID}}' \
    --header 'Authorization: TOKEN {{token}}' \
    --data-raw '{
        "status": "active"
    }'

    Response Example

    An example response of the PATCH request for enabling an application is shown here:

    Status: 200 OK
    {
      "tenantId": null,
      "catalogAppId": 3,
      "status": "active",
      "hasValidPaps": null,
      "catalogAppDisplayName": "Azure1",
      "deleted": null,
      "deletedBy": null,
      "allEnvironmentGroupMap": {
      ...........................
      ......
     "DefaultDirectory382.onmicrosoft.com": {
          "name": "DefaultDirectory382.onmicrosoft.com",
          "description": null,
          "id": "DefaultDirectory382.onmicrosoft.com",
          "parentId": "",
          "nativeId": "DefaultDirectory382.onmicrosoft.com",
          "nativeParentId": "",
          "childGroupIds": [
            "6ed83eea-639b-44ef-a860-486761c02803"
          ],
          "childEnvironmentIds": [],
          "type": "Directory",
          "internalParentId": ""
        },
        "6ed83eea-639b-44ef-a860-486761c02803": {
        ...........................
        ......
      },
       "catalogApplication": {
        ...........................
        ......
        "rootEnvironmentGroup": {
           "environmentGroups": [
            {
            "name": "DefaultDirectory382.onmicrosoft.com",
            "description": null,
            "id": "DefaultDirectory382.onmicrosoft.com",
            "parentId": "",
            "nativeId": "DefaultDirectory382.onmicrosoft.com",
            "nativeParentId": "",
            "childGroupIds": [
        ...........................
        ...... 
        "childEnvironmentIds": [],
            "type": "Directory",
            "internalParentId": ""
          },
          {
        ...........................
        ...... 
      ],
        "environments": [
          {
            "id": "64738ffe-22fe-40fb-9380-8b5af077d244",
            "name": "Dev Subscription",
            "description": null,
            "parentGroupId": "development1",
            "type": "Subscription",
            "internalParentId": "development1"
          },
          {
        ...........................
        ...... 
          {
          ]
      },
      "catalogAppName": "Azure",
      "catalogAppVersion": "1.0",
      "iconUrl": "/images/app_logos/azure.png",
      "appContainerId": "62hnp3zkv5jx1p8k74zj",
      "userAccountMappings": []
    }

    7. Disable Application

    The PATCH method can also disable an application.

    PATCH{{url}}/api/apps/{{appID}}

    Request Example

    An example PATCH request for disabling an application is shown here.

    curl --location --request PATCH '{{url}}/api/apps/{{appID}}' \
    --header 'Authorization: TOKEN {{token}}' \
    --data-raw '{
        "status": "inactive"
    }'

    Response Example

    An example response of the PATCH request for disabling an application is shown here.

    Status: 200 OK
    {
        "tenantId": null,
        "catalogAppId": 3,
        "status": "inactive",
        "hasValidPaps": null,
        "catalogAppDisplayName": "Azure1",
        "deleted": null,
        "deletedBy": null,
        "catalogAppName": "Azure",
        "rootEnvironmentGroup": {
            "environmentGroups": [
                {
                    "name": "DefaultDirectory382.onmicrosoft.com",
                    "description": null,
                    "id": "DefaultDirectory382.onmicrosoft.com",
                    "parentId": "",
                    "nativeId": "DefaultDirectory382.onmicrosoft.com",
                    "nativeParentId": "",
                    "childGroupIds": [
                        "6ed83eea-639b-44ef-a860-486761c02803"
                    ],
                    "childEnvironmentIds": [],
                    "type": "Directory",
                    "internalParentId": ""
                },
                {
                .............................
                ..........
                 ]
        },
        "catalogApplication": {
            "catalogAppId": 3,
            "key": "Azure-1.0",
            "name": "Azure",
            "version": "1.0",
            "status": "active",
            "description": "Microsoft Azure",
            "propertyTypes": [
                {
                    "type": "java.lang.String",
                    "enumType": null,
                    "enumValues": [],
                    "name": "iconUrl",
                    "description": "The App's Icon URL Path",
                    "required": true,
                    "value": "/images/app_logos/azure.png",
                    "global": false,
                    "privy": false,
                    "enumNameMap": null,
                    "readOnly": false
                },
                {
                ......................
                .........
                ],
            "uiSettings": {
                "sections": [
                    {
                        "properties": [
                            "displayName",
                            "description"
                        ],
                        "displayName": "Application"
                    },
                    {
                        "groups": [
                            {
                                "properties": [
                        ............................
                        ............
                  "displayName": "Credential Type"
                            },
                            {
                        ............................
                        ............
                        ],
                        "displayName": "Settings"
                    }
                ]
            },
            "requiresAccountMapping": false,
            "supportedPermissionTypes": {
            ............................
            ............ 
            "supportsEnvironmentScanning": true,
            "papExpirationSettings": {
            ..........................
            ........
            "supportsTokens": true,
            "requiresHierarchicalModel": true,
            "supportsResources": true,
            "supportsAutoRegistration": false,
            "allowAssociationsInProfiles": true,
            "allowServiceIdentitiesInProfiles": true
        },
        "allEnvironmentGroupMap": {
        "DefaultDirectory382.onmicrosoft.com": {
                "name": "DefaultDirectory382.onmicrosoft.com",
                "description": null,
                "id": "DefaultDirectory382.onmicrosoft.com",
                "parentId": "",
                "nativeId": "DefaultDirectory382.onmicrosoft.com",
                "nativeParentId": "",
                "childGroupIds": [
                    "6ed83eea-639b-44ef-a860-486761c02803"
                ],
                "childEnvironmentIds": [],
                "type": "Directory",
                "internalParentId": ""
            },
            "6ed83eea-639b-44ef-a860-486761c02803": {
       ......................................
       .........
       ......
            },
        "catalogAppVersion": "1.0",
        "iconUrl": "/images/app_logos/azure.png",
        "appContainerId": "62hnp3zkv5jx1p8k74zj",
        "userAccountMappings": []
    }            

    Was this article helpful?