GetProjectID returns the project ID from a resource name.
(name string)
| 70 | |
| 71 | // GetProjectID returns the project ID from a resource name. |
| 72 | func GetProjectID(name string) (string, error) { |
| 73 | tokens, err := GetNameParentTokens(name, ProjectNamePrefix) |
| 74 | if err != nil { |
| 75 | return "", err |
| 76 | } |
| 77 | return tokens[0], nil |
| 78 | } |
| 79 | |
| 80 | // GetProjectIDDatabaseGroupID returns the project ID and database group ID from a resource name. |
| 81 | func GetProjectIDDatabaseGroupID(name string) (string, string, error) { |
no test coverage detected