AIP-9001

Standard Field Codes

Standard fields are defined in AIP-148. At Kolla, where we use many generators to scaffold our API manifests, it is helpful to further define opinions like the Proto codes and placement of the standard timestamps fields for consistency in reading API manifests.

Guidance

Standard fields with timestamps (e.g. create_time) should be at the end of a resource message.

Standard fields with timestamps should be numbered as follows:

    // create time
    google.protobuf.Timestamp create_time = 90 [(google.api.field_behavior) = OUTPUT_ONLY];
    // time of last update
    google.protobuf.Timestamp update_time = 91 [(google.api.field_behavior) = OUTPUT_ONLY];
    // delete time (for soft deleting)
    google.protobuf.Timestamp delete_time = 92 [(google.api.field_behavior) = OUTPUT_ONLY];
    // expire time says when to do the hard delete after the soft delete
    google.protobuf.Timestamp expire_time = 93 [(google.api.field_behavior) = OUTPUT_ONLY];

Standard field uid should be the second element of a resource:

message Test {
    //...
    // name ID of the APP ;-)
    string name = 1;
    // The system ID of the resource
    string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
    //...
}

Changelog

  • 2021-10-27: Creation