MCPcopy Index your code
hub / github.com/bytebase/bytebase / GetInstanceID

Function GetInstanceID

backend/common/resource_name.go:140–147  ·  view source on GitHub ↗

GetInstanceID returns the instance ID from a resource name.

(name string)

Source from the content-addressed store, hash-verified

138
139// GetInstanceID returns the instance ID from a resource name.
140func GetInstanceID(name string) (string, error) {
141 // the instance request should be instances/{instance-id}
142 tokens, err := GetNameParentTokens(name, InstanceNamePrefix)
143 if err != nil {
144 return "", err
145 }
146 return tokens[0], nil
147}
148
149// GetInstanceDatabaseID returns the instance ID and database ID from a resource name.
150func GetInstanceDatabaseID(name string) (string, string, error) {

Callers 14

unfoldSpecTargetsFunction · 0.92
GetListDatabaseFilterFunction · 0.92
TestSQLExportFunction · 0.92
getInstanceIDMethod · 0.92
ListInstanceDatabaseMethod · 0.92
UpdateInstanceMethod · 0.92
getInstanceMessageFunction · 0.92
populateRawResourcesFunction · 0.92
validateSpecsFunction · 0.92

Calls 1

GetNameParentTokensFunction · 0.70

Tested by 4

TestSQLExportFunction · 0.74