Skip to main content

Module names

Module names 

Source
Expand description

Full resource names (AIP-122), the platform’s identifiers: //{service}.origincloudapis.eu/{relative name}, such as //pvs.origincloudapis.eu/projects/p/zones/eu-central1-az1/volumes/vol-1.

A resource’s name is its relative name; its full name puts the host of the service that owns it in front, with no scheme and no API version. References in request bodies are full names. A request’s path fields (name, parent) take either: a client given a full name of its own service sends its relative name, and refuses one of another service before sending anything.

use origincloud_core::names::FullName;

let volume: FullName =
    "//pvs.origincloudapis.eu/projects/p/zones/eu-central1-az1/volumes/vol-1".parse()?;
assert_eq!(volume.service(), "pvs");
assert_eq!(volume.host(), "pvs.origincloudapis.eu");
assert_eq!(volume.relative(), "projects/p/zones/eu-central1-az1/volumes/vol-1");
assert_eq!(
    volume.url("v1beta1")?,
    "https://pvs.origincloudapis.eu/v1beta1/projects/p/zones/eu-central1-az1/volumes/vol-1"
);
assert_eq!(
    FullName::from_relative("pvs", "projects/p/zones/eu-central1-az1/volumes/vol-1")?,
    volume
);

Structs§

FullName
A full resource name: //, the global host of the service that owns the resource, / and its relative name.

Enums§

FullNameError
Why a string is not a full resource name, or not one that can be used where it was given.
Principal
Who acts: a principal, as a member of a role binding or the actor of an audit entry names it. Each is an iam full name.

Constants§

ANY_SERVICE
Every resource service, in the services a path field takes: a field referring to any type (google.api.resource_reference’s type: "*").
DOMAIN
The domain every service’s host is under.
RESOURCE_SERVICES
The services that have resources, by their short code, in order: the domains of the resource types the API declares (pvs.origincloudapis.eu/Volume), and so the hosts a full resource name may start with, {service}.origincloudapis.eu. A service without resources of its own, such as sts, names nothing.