Exemple #1
0
        public void ParseUnknown()
        {
            var resource = ManagedResource.Parse("aws/i-1");

            Assert.Equal(2, ResourceProvider.Get(resource.ProviderId).Id);
            Assert.Equal("unknown", resource.Type.Name);
            Assert.Equal("i-1", resource.ResourceId);
            Assert.Equal("aws:unknown/i-1", resource.ToString());
        }
Exemple #2
0
        public void ParseHost()
        {
            var resource = ManagedResource.Parse("aws:host/18");

            Assert.Equal("AWS", ResourceProvider.Get(resource.ProviderId).Name);
            Assert.Equal(ResourceTypes.Host, resource.Type);
            Assert.Equal("18", resource.ResourceId);
            Assert.Equal("aws:host/18", resource.ToString());
        }
Exemple #3
0
        public void ParseWithZone()
        {
            var resource = ManagedResource.Parse("aws:us-east-1a:host/i-1");

            Assert.Equal(2, ResourceProvider.Get(resource.ProviderId).Id);
            Assert.Equal("host", resource.Type.Name);
            Assert.Equal("i-1", resource.ResourceId);
            Assert.Equal("aws:us-east-1a:host/i-1", resource.ToString());
        }
Exemple #4
0
        public void ParseLocation()
        {
            var resource = ManagedResource.Parse("aws:location/us-east-1b");

            Assert.Equal(2, resource.ProviderId);
            Assert.Equal(ResourceTypes.Location, resource.Type);
            Assert.Equal("us-east-1b", resource.ResourceId);

            Assert.Equal("aws:location/us-east-1b", resource.ToString());
        }
Exemple #5
0
        public void ParseHostWithZone()
        {
            var resource = ManagedResource.Parse("aws:us-east-1:host/18");

            Assert.Equal(2, resource.ProviderId);
            Assert.Equal(ResourceTypes.Host, resource.Type);
            Assert.Equal("18", resource.ResourceId);

            Assert.Equal("aws:us-east-1:host/18", resource.ToString());
        }
Exemple #6
0
 public ResourceConflictException(ManagedResource resource)
     : base(resource.ToString() + " already exists")
 {
 }
Exemple #7
0
 public ResourceNotFoundException(ManagedResource resource)
     : base(resource.ToString() + " not found")
 {
 }
Exemple #8
0
 public static ResourceNotFoundException NotFound(ManagedResource resource)
 {
     return(new ResourceNotFoundException(resource));
 }