Getting the service account ID

    If you don't have a service account yet, create one.

    1. Go to the folder that the service account belongs to.

    2. Go to the Service accounts tab.

    3. Choose a service account and click the line with its name.

    4. For the service account ID, see Overview:


    The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

    If you know the service account name, use the get command to get the account ID:

    $ yc iam service-account get my-robot
    id: aje6o61dvog2h6g9a33s

    If you don't know the name, get a list of service accounts in the default folder:

    $ yc iam service-account list
    |          ID          |       NAME       |          DESCRIPTION          |
    | aje6o61dvog2h6g9a33s | my-robot         |                               |
    | aje9sda1ufvqcmfksd3f | blabla           | bla bla bla is my description |
    1. Get the ID of the folder that the service account was created in.

    2. Get information about the service accounts in the folder using the list method:

      $ export FOLDER_ID=b1gvmob95yysaplct532
      $ export IAM_TOKEN=CggaATEVAgA...
      $ curl -H "Authorization: Bearer ${IAM_TOKEN}" \
       "serviceAccounts": [
         "id": "ajebqtreob2dpblin8pe",
         "folderId": "b1gvmob95yysaplct532",
         "createdAt": "2018-10-18T13:42:40Z",
         "name": "my-robot",
         "description": "my description"