Use case flow for WAN and LAN-based view operations

This topic describes the workflow for view operations conducted over Wide Area Networks (WAN) and Local Area Networks (LAN).

WAN-based view operations

This content guides you through a typical workflow for WAN-based views using the API. Each step includes example requests and expected responses to help you perform the operations smoothly.

Workflow steps:

  1. Authenticate:

    Authenticate to the CCRC WAN server by sending a login request.

    Request example:
    
    {
      "operationName": "login",
      "operationArguments": {
        "userName": "alice",
        "password": "alicePass",
        "ccrcWanServerURL": "https://wan.example.com/ccrc",
        "primaryGroupName": "clearcase",
        "groupList": ["clearcase", "devs", "qa"]
      }
    }
    Successful response:
    
    {
      "responseCode": 200,
      "responseMsg": "User alice is logged in successfully.",
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.dXNlcm5hbWU6ImR1bW15dXNlciIsImV4cCI6MTY4MDAwMDAwMH0.abc123XYZ456def789GHI012jkl345MNO678pqr901STU234vwx567YZ"
    }
    Note: Save the token from the response for all subsequent operations.
  2. Checkout: Use the authentication token to check-out a file.

    Request example:

    
    {
      "communication": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.dXNlcm5hbWU6ImR1bW15dXNlciIsImV4cCI6MTY4MDAwMDAwMH0.abc123XYZ456def789GHI012jkl345MNO678pqr901STU234vwx567YZ"
      },
      "operationArguments": {
        "reserved": true,
        "scmResources": [
          {
            "comment": "Bug fix",
            "resourcePath": "/views/test_view/test_vob/file1.txt"
          }
        ]
      },
      "operationName": "checkout"
    }
    
    Successful response:
    
    {
        "responseCode":200,
        "responseMsg":"The operation is successful.",
        "resourceInfoList":
            [
                {
                    "resourcePath":"/views/test_view/test_vob/file1.txt",
                    "error":null
                 }
             ]
    }
  3. Checkin:

    After making your changes, check in the file using the same token.

    Request example:
    
    {
      "communication": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.dXNlcm5hbWU6ImR1bW15dXNlciIsImV4cCI6MTY4MDAwMDAwMH0.abc123XYZ456def789GHI012jkl345MNO678pqr901STU234vwx567YZ"
      },
      "operationArguments": {
        "checkinIdentical": true,
        "scmResources": [
          {
            "comment": "Bug fix",
            "resourcePath": "/views/test_view/test_vob/file1.txt"
          }
        ]
      },
      "operationName": "checkin"
    }
    
    Successful response:
    
    {
        "responseCode":200,
        "responseMsg":"The operation is successful.",
        "resourceInfoList":
            [
                {
                    "resourcePath":"/views/test_view/test_vob/file1.txt",
                    "error":null
                 }
             ]
    }
  4. Logout:

    After your work is completed, log out to end your session.

    Request example:
    
    {
      "communication": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.dXNlcm5hbWU6ImR1bW15dXNlciIsImV4cCI6MTY4MDAwMDAwMH0.abc123XYZ456def789GHI012jkl345MNO678pqr901STU234vwx567YZ"
      },
      "operationName": "logout"
    }
    
    Successful response:
    
    {
      "responseCode": 200,
      "responseMsg": "User alice is logged out successfully."
    }
    Note: This workflow provides a practical example for performing basic operations with WAN-based views. For more details on each operation, see the API documentation.

LAN-based view operations

For LAN-based views, the workflow is simpler. Authentication is not required, so you can perform operations directly.

Checkin:

Request example:

{
  "operationArguments": {
    "checkinIdentical": true,
    "scmResources": [
      {
        "comment": "Bug fix",
        "resourcePath": "/views/test_view/test_vob/file1.txt"
      }
    ]
  },
  "operationName": "checkin"
}

Successful response:

{
  "resourceInfoList": [
    {
      "error": null,
      "resourcePath": "/views/test_view/test_vob/file1.txt"
    }
  ],
  "responseCode": 200,
  "responseMsg": "The operation is successful."
}

For more details on each operation, see the API documentation.