github.com/GoogleCloudPlatform/testgrid@v0.0.174/cmd/api/README.md (about)

     1  # API
     2  
     3  This component exposes TestGrid data publicly that could otherwise be viewed through the UI.
     4  
     5  ## Local development
     6  See also [common tips](/cmd/README.md) for running locally.
     7  
     8  The surface of the API is described in this (proto definition)[/pb/api/v1/data.proto]. Usage is similar between protocols.
     9  
    10  You may want to set `--scope=gs://your-bucket`. This will set this as the server's default; otherwise you'll be required to specify with each call.
    11  
    12  If you're using this for developing in the `web/` directory, optionally set `--allowed-origin=*` to avoid
    13  CORS issues.
    14  
    15  ```bash
    16  bazelisk run //cmd/api -- \
    17    # --scope=gs://your-bucket
    18    # --allowed-origin=*
    19  ```
    20  
    21  ### HTTP
    22  
    23  Use the `--http-port` option to set the listening port. Default is 8080.
    24  
    25  You can specify further with URL parameters: `?scope=gs://your-bucket`.
    26  
    27  `curl localhost:8080/api/v1/dashboards`
    28  
    29  ### gRPC
    30  
    31  Use the `--grpc-port` option to set the listening port. Default is 50051.
    32  
    33  `grpc_cli call localhost:50051 testgrid.api.v1.TestGridData.ListDashboard`
    34  
    35  Reflection is enabled in gRPC, allowing you to ask the server what methods are available.
    36  
    37  `grpc_cli ls localhost:50051 testgrid.api.v1.TestGridData`