예제 #1
0
        private static Instance GetMetadata()
        {
            MetadataClient client   = MetadataClient.Create();
            var            instance = client.GetInstanceMetadata();

            return(instance);
        }
        public void GetInstanceMetadata()
        {
            // Snippet: GetInstanceMetadata
            MetadataClient client   = MetadataClient.Create();
            Instance       instance = client.GetInstanceMetadata();

            Console.Write(instance.Zone);
            // End snippet

            Assert.Equal(instance.Zone, "projects/12345/zones/us-central1-f");
        }