Ejemplo n.º 1
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string        connectionData      = request.ConnectionData;
            var           deprovisionResult   = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest            = request.Manifest;
            var           developerParameters = request.DeveloperParameters;
            var           developerOptions    = GoogleCloudDeveloperOptions.Parse(developerParameters);

            try
            {
                var conInfo = ConnectionInfo.Parse(connectionData);
                developerOptions.InstanceName = conInfo.InstanceName;
                developerOptions.Zone         = conInfo.Zone;
                var op = new InstanceOperations(manifest, developerOptions);
                op.RemoveInstance();
                deprovisionResult.IsSuccess      = true;
                deprovisionResult.EndUserMessage = "Successfully deleted instance: " + conInfo.InstanceName;
            }

            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
                deprovisionResult.IsSuccess      = false;
            }
            return(deprovisionResult);
        }
Ejemplo n.º 2
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            try
            {
                var parameters = DeveloperParameters.Parse(request.Manifest, request.DeveloperParameters);
                // todo check parameters
                // creates a secure password of length 16. we can customize this further if needed
                var connection = new OdbcConnection($"Driver={{Altibase}};Server={parameters.AltibaseHost};UID={parameters.AltibaseUsername};PWD={parameters.AltibasePassword};Database={parameters.AltibaseDB}");
                var queryString = $"drop user {parameters.SchemaName}";
                var cmd = new OdbcCommand(queryString, connection);
                connection.Open();
                connection.Close();
                return new OperationResult()
                {
                    IsSuccess = true,
                    EndUserMessage = "Deprovision OK"
                };
            }
            catch (Exception e)
            {
                Log.Error(e.Data);
                return new OperationResult()
                {

                };
            }
        }
        // Testing Instance
        // Input: AddonTestRequest request
        // Output: OperationResult
        public override OperationResult Test(AddonTestRequest request)
        {
            var testResult = new OperationResult {IsSuccess = false};
            var apr = new AddonProvisionRequest
            {
                DeveloperParameters = request.DeveloperParameters,
                Manifest = request.Manifest
            };

            var dpr = new AddonDeprovisionRequest
            {
                DeveloperParameters = request.DeveloperParameters,
                Manifest = request.Manifest
            };
            var provisionTest = Provision(apr);
            if (!provisionTest.IsSuccess)
            {
                return provisionTest;
            }
            var testProgress = provisionTest.EndUserMessage;
            var deprovisionTest = Deprovision(dpr);
            if (!deprovisionTest.IsSuccess)
            {
                return deprovisionTest;
            }
            testProgress += deprovisionTest.EndUserMessage;
            testResult.IsSuccess = true;
            testResult.EndUserMessage = testProgress;
            return testResult;
        }
Ejemplo n.º 4
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var result = new OperationResult();

            try
            {
                NewDatabase = GetDatabaseName(request.Manifest);
                NewUserId   = GetNewUsername(request.Manifest);

                log.InfoFormat("Removing MsSql database: {0}", NewDatabase);

                using (var connection = GetConnection(request.Manifest.Properties))
                {
                    DropUser(connection);

                    DropDatabase(connection);
                }

                result.IsSuccess      = true;
                result.EndUserMessage = "Successfully removed a MsSql database.";

                log.InfoFormat("Successfully removed MsSql database: {0}", NewDatabase);
            }
            catch (Exception ex)
            {
                result.IsSuccess      = false;
                result.EndUserMessage = ex.Message;

                log.ErrorFormat("Failed to remove MsSql database '{0}': {1}", NewDatabase, ex.Message);
                log.Error(ex.StackTrace);
            }

            return(result);
        }
Ejemplo n.º 5
0
        // Testing Instance
        // Input: AddonTestRequest request
        // Output: OperationResult
        public override OperationResult Test(AddonTestRequest request)
        {
            var testResult = new OperationResult {
                IsSuccess = false
            };
            var apr = new AddonProvisionRequest
            {
                DeveloperParameters = request.DeveloperParameters,
                Manifest            = request.Manifest
            };

            var dpr = new AddonDeprovisionRequest
            {
                DeveloperParameters = request.DeveloperParameters,
                Manifest            = request.Manifest
            };
            var provisionTest = Provision(apr);

            if (!provisionTest.IsSuccess)
            {
                return(provisionTest);
            }
            var testProgress    = provisionTest.EndUserMessage;
            var deprovisionTest = Deprovision(dpr);

            if (!deprovisionTest.IsSuccess)
            {
                return(deprovisionTest);
            }
            testProgress             += deprovisionTest.EndUserMessage;
            testResult.IsSuccess      = true;
            testResult.EndUserMessage = testProgress;
            return(testResult);
        }
Ejemplo n.º 6
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var deprovisionResult = new ProvisionAddOnResult("") { IsSuccess = true };
            deprovisionResult.ConnectionData = "deprovision";
            AddonManifest manifest = request.Manifest;
            string connectionData = request.ConnectionData;
            string devOptions = request.DeveloperOptions;
            //string jobid = null;

            try
            {
                IAmazonElasticMapReduce client;
                //var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = EMRDeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return deprovisionResult;
                }

                var result = client.TerminateJobFlows(new TerminateJobFlowsRequest() { JobFlowIds = { connectionData } });

                deprovisionResult.IsSuccess = true;
                deprovisionResult.EndUserMessage = "EMR Cluster Termination Request Successfully Invoked.";
            }
            catch (Exception)
            {
                deprovisionResult.EndUserMessage = "An error occurred during deprovisioning, please check the SOC logs for further assistance.";
            }

            return deprovisionResult;
        }
        public override OperationResult Deprovision(AddonDeprovisionRequest _request)
        {
            var deprovisionResult = new OperationResult {
                EndUserMessage = string.Empty, IsSuccess = false
            };

            var manifest      = _request.Manifest;
            var devParameters = _request.DeveloperParameters;
            var devOptions    = BMDeveloperOptions.Parse(devParameters, manifest);

            end_point  = devOptions.api_url;
            bm_version = devOptions.api_version;

            try
            {
                var    token       = authenticate(devOptions.bluemixuser, devOptions.bluemixpass);
                string name        = devOptions.name;
                var    serviceGUID = getServiceGUID(token, name);
                var    status      = deleteServiceInstance(token, name, serviceGUID);
                log.Info("BluemixAddon Deprovisioned Successfully");
            }
            catch (Exception ex)
            {
                var errorMessage = string.Format("BluemixAddon Deprovision Error: {0}\n{1}", ex, ex.StackTrace);
                log.Error(errorMessage);
                deprovisionResult.EndUserMessage = errorMessage;
                return(deprovisionResult);
            }

            deprovisionResult.IsSuccess = true;
            return(deprovisionResult);
        }
Ejemplo n.º 8
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var connectionData = request.ConnectionData;
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            var devOptions = DeveloperParameters.Parse(request.DeveloperParameters, request.Manifest.GetProperties());
            // set up the credentials for azure
            SubscriptionCloudCredentials creds = CertificateAuthenticationHelper.GetCredentials(devOptions.AzureManagementSubscriptionId, devOptions.AzureAuthenticationKey);
            // set up the storage management client
            var client = new StorageManagementClient(creds);

            // AI-121 & AI-122
            // we're going to have to implement some additional handling here, including parsing of the connection data
            // i strongly recommend we look at putting this in json

            // then if requested, delete the storage account name
            client.StorageAccounts.Delete(devOptions.StorageAccountName);

            do
            {
                var verificationResponse = client.StorageAccounts.Get(devOptions.StorageAccountName);

                if (verificationResponse.StorageAccount.Properties.Status.Equals(StorageAccountStatus.Deleting))
                {
                    deprovisionResult.IsSuccess = true;
                    deprovisionResult.EndUserMessage = "Deprovision Request Complete, please allow a few minutes for resources to be fully deleted.";
                    break;
                }
                Thread.Sleep(TimeSpan.FromSeconds(10d));
            }
            while (true);
            return deprovisionResult;
        }
Ejemplo n.º 9
0
        // Deprovision RDS Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest = request.Manifest;
            string devOptions = request.DeveloperOptions;

            try
            {
                AmazonSQSClient client;
                var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = DeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return deprovisionResult;
                }

                var response =
                    client.DeleteQueue(new DeleteQueueRequest()
                    {
                        QueueUrl = conInfo.queueURL
                    });

                do  {
                        var verificationResponse = client.GetQueueUrl(new GetQueueUrlRequest()
                        {
                            QueueName = conInfo.queueName,
                            QueueOwnerAWSAccountId = developerOptions.AccessKey,
                        });
                        // 5/22/14 fixing amazaon aws deprecration
                        if (verificationResponse.QueueUrl == null)
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        Thread.Sleep(TimeSpan.FromSeconds(10d));

                    } while (true);
                }

            catch (QueueDoesNotExistException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (QueueDeletedRecentlyException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return deprovisionResult;
        }
Ejemplo n.º 10
0
        // Deprovision RDS Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var           deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest          = request.Manifest;
            string        devOptions        = request.DeveloperOptions;

            try
            {
                AmazonSQSClient client;
                var             conInfo          = ConnectionInfo.Parse(connectionData);
                var             developerOptions = DeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return(deprovisionResult);
                }

                var response =
                    client.DeleteQueue(new DeleteQueueRequest()
                {
                    QueueUrl = conInfo.queueURL
                });

                do
                {
                    var verificationResponse = client.GetQueueUrl(new GetQueueUrlRequest()
                    {
                        QueueName = conInfo.queueName,
                        QueueOwnerAWSAccountId = developerOptions.AccessKey,
                    });
                    // 5/22/14 fixing amazaon aws deprecration
                    if (verificationResponse.QueueUrl == null)
                    {
                        deprovisionResult.IsSuccess = true;
                        break;
                    }
                    Thread.Sleep(TimeSpan.FromSeconds(10d));
                } while (true);
            }

            catch (QueueDoesNotExistException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (QueueDeletedRecentlyException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return(deprovisionResult);
        }
Ejemplo n.º 11
0
        // Deprovision RDS Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var           deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest          = request.Manifest;
            string        devOptions        = request.DeveloperOptions;

            try
            {
                AmazonGlacierClient client;
                var conInfo          = ConnectionInfo.Parse(connectionData);
                var developerOptions = DeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return(deprovisionResult);
                }
                var getArchivesInVault = client.DescribeVault(new DescribeVaultRequest()
                {
                    AccountId = conInfo.AccountId, VaultName = conInfo.VaultName
                });
                var response =
                    client.DeleteVault(new DeleteVaultRequest()
                {
                    AccountId = conInfo.AccountId,
                    VaultName = conInfo.VaultName
                });
                // 5/22/14 fixing amazon aws deprecation
                if (response.HttpStatusCode != null)
                {
                    do
                    {
                        var verificationResponse = client.DescribeVault(new DescribeVaultRequest()
                        {
                        });
                        // 5/22/14 fixing amazaon aws deprecration
                        if (verificationResponse == null)
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        Thread.Sleep(TimeSpan.FromSeconds(10d));
                    } while (true);
                }
            }
            catch (ResourceNotFoundException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return(deprovisionResult);
        }
 public override OperationResult Deprovision(AddonDeprovisionRequest request)
 {
     return(new OperationResult()
     {
         EndUserMessage = "AddOn successfully deprovisioned!",
         IsSuccess = true
     });
 }
        // Deprovision Redshift Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest = request.Manifest;

            string devOptions = request.DeveloperOptions;

            try
            {
                AmazonRedshiftClient client;
                var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = RedshiftDeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return deprovisionResult;
                }

                var response =
                    client.DeleteCluster(new DeleteClusterRequest()
                    {
                        ClusterIdentifier = conInfo.ClusterIdentifier,
                        //SkipFinalSnapshot = true
                    });
                // modified 5/22/14 to fix deprecation in Amazon AWS SDK
                if (response.Cluster != null)
                {
                    do
                    {
                        var verificationResponse = client.DescribeClusters(new DescribeClustersRequest()
                        {
                            ClusterIdentifier = conInfo.ClusterIdentifier
                        });
                        // modified 5/22/14 to fix deprecation in Amazon AWS SDK
                        if (!verificationResponse.Clusters.Any())
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        Thread.Sleep(TimeSpan.FromSeconds(10d));

                    } while (true);
                }
            }
            catch (ClusterNotFoundException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return deprovisionResult;
        }
        // Deprovision RDS Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest = request.Manifest;
            string devOptions = request.DeveloperOptions;

            try
            {
                AmazonGlacierClient client;
                var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = DeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return deprovisionResult;
                }
                var getArchivesInVault = client.DescribeVault(new DescribeVaultRequest() { AccountId = conInfo.AccountId, VaultName = conInfo.VaultName });
                var response =
                    client.DeleteVault(new DeleteVaultRequest()
                    {
                        AccountId = conInfo.AccountId,
                        VaultName = conInfo.VaultName
                    });
                // 5/22/14 fixing amazon aws deprecation
                if (response.HttpStatusCode != null)
                {
                    do
                    {
                        var verificationResponse = client.DescribeVault(new DescribeVaultRequest()
                        {

                        });
                        // 5/22/14 fixing amazaon aws deprecration
                        if (verificationResponse == null)
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        Thread.Sleep(TimeSpan.FromSeconds(10d));

                    } while (true);
                }
            }
            catch (ResourceNotFoundException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return deprovisionResult;
        }
Ejemplo n.º 15
0
        // Deprovision RDS Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var           deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest          = request.Manifest;
            string        devOptions        = request.DeveloperOptions;

            try
            {
                AmazonRDSClient client;
                var             conInfo          = ConnectionInfo.Parse(connectionData);
                var             developerOptions = DeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return(deprovisionResult);
                }

                var response =
                    client.DeleteDBInstance(new DeleteDBInstanceRequest()
                {
                    DBInstanceIdentifier = conInfo.DbInstanceIdentifier,
                    SkipFinalSnapshot    = true
                });
                // 5/22/14 fixing amazon aws deprecation
                if (response.DBInstance != null)
                {
                    do
                    {
                        var verificationResponse = client.DescribeDBInstances(new DescribeDBInstancesRequest()
                        {
                            DBInstanceIdentifier = conInfo.DbInstanceIdentifier
                        });
                        // 5/22/14 fixing amazaon aws deprecration
                        if (!verificationResponse.DBInstances.Any())
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        Thread.Sleep(TimeSpan.FromSeconds(10d));
                    } while (true);
                }
            }
            catch (DBInstanceNotFoundException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return(deprovisionResult);
        }
Ejemplo n.º 16
0
        // Deprovision Redshift Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string        connectionData    = request.ConnectionData;
            var           deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest          = request.Manifest;

            string devOptions = request.DeveloperOptions;

            try
            {
                AmazonRedshiftClient client;
                var conInfo          = ConnectionInfo.Parse(connectionData);
                var developerOptions = RedshiftDeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return(deprovisionResult);
                }

                var response =
                    client.DeleteCluster(new DeleteClusterRequest()
                {
                    ClusterIdentifier = conInfo.ClusterIdentifier,
                    //SkipFinalSnapshot = true
                });
                // modified 5/22/14 to fix deprecation in Amazon AWS SDK
                if (response.Cluster != null)
                {
                    do
                    {
                        var verificationResponse = client.DescribeClusters(new DescribeClustersRequest()
                        {
                            ClusterIdentifier = conInfo.ClusterIdentifier
                        });
                        // modified 5/22/14 to fix deprecation in Amazon AWS SDK
                        if (!verificationResponse.Clusters.Any())
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        Thread.Sleep(TimeSpan.FromSeconds(10d));
                    } while (true);
                }
            }
            catch (ClusterNotFoundException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return(deprovisionResult);
        }
Ejemplo n.º 17
0
        // Deprovision RDS Instance
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest = request.Manifest;
            string devOptions = request.DeveloperOptions;

            try
            {
                AmazonRDSClient client;
                var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = DeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return deprovisionResult;
                }

                var response =
                    client.DeleteDBInstance(new DeleteDBInstanceRequest()
                        {
                            DBInstanceIdentifier = conInfo.DbInstanceIdentifier,
                            SkipFinalSnapshot = true
                        });
                // 5/22/14 fixing amazon aws deprecation
                if (response.DBInstance != null)
                {
                    do
                    {
                        var verificationResponse = client.DescribeDBInstances(new DescribeDBInstancesRequest()
                            {
                                DBInstanceIdentifier = conInfo.DbInstanceIdentifier
                            });
                        // 5/22/14 fixing amazaon aws deprecration
                        if (!verificationResponse.DBInstances.Any())
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        Thread.Sleep(TimeSpan.FromSeconds(10d));
                    } while (true);
                }
            }
            catch (DBInstanceNotFoundException)
            {
                deprovisionResult.IsSuccess = true;
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }

            return deprovisionResult;
        }
Ejemplo n.º 18
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest = request.Manifest;
            string devOptions = request.DeveloperOptions;
            try
            {
                AmazonSimpleNotificationServiceClient client;
                var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = DeveloperOptions.Parse(devOptions);
                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return deprovisionResult;
                }
                var response =
                    client.DeleteTopic(new DeleteTopicRequest()
                    {
                        TopicArn = conInfo.TopicArn
                    });
                if (response.HttpStatusCode != null)
                {
                    do
                    {
                        // ok, to verify deletion, we need to list all of the topics and search for the one we just deleted.
                        // if it's still there, its probably in queue to be deleted, we'll sleep the thread and give it a minute.
                        // once its gone, we'll return true.
                        // if after an intolerable amount of time the queue is still there, throw an error.
                        var verificationResponse = client.ListTopics(new ListTopicsRequest());
                        // if there are no topics, ok!
                        if (verificationResponse.Topics.Count == 0)
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        // if there are existing topics, search for the one we just deleted.
                        if(verificationResponse.Topics.Find(m => m.TopicArn.Equals(conInfo.TopicArn)) == null)
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        // otherwise, the topic still exists and we need to wait a little longer.
                        Thread.Sleep(TimeSpan.FromSeconds(10d));

                    } while (true);
                }
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage += "An error occurred during deletion. Your SNS queue may be deleted, but we were unable to verify. Please check your AWS Console.";
                deprovisionResult.EndUserMessage += e.Message;
            }
            return deprovisionResult;
        }
Ejemplo n.º 19
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var           deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest          = request.Manifest;
            string        devOptions        = request.DeveloperOptions;

            try
            {
                AmazonSimpleNotificationServiceClient client;
                var conInfo               = ConnectionInfo.Parse(connectionData);
                var developerOptions      = DeveloperOptions.Parse(devOptions);
                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return(deprovisionResult);
                }
                var response =
                    client.DeleteTopic(new DeleteTopicRequest()
                {
                    TopicArn = conInfo.TopicArn
                });
                if (response.HttpStatusCode != null)
                {
                    do
                    {
                        // ok, to verify deletion, we need to list all of the topics and search for the one we just deleted.
                        // if it's still there, its probably in queue to be deleted, we'll sleep the thread and give it a minute.
                        // once its gone, we'll return true.
                        // if after an intolerable amount of time the queue is still there, throw an error.
                        var verificationResponse = client.ListTopics(new ListTopicsRequest());
                        // if there are no topics, ok!
                        if (verificationResponse.Topics.Count == 0)
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        // if there are existing topics, search for the one we just deleted.
                        if (verificationResponse.Topics.Find(m => m.TopicArn.Equals(conInfo.TopicArn)) == null)
                        {
                            deprovisionResult.IsSuccess = true;
                            break;
                        }
                        // otherwise, the topic still exists and we need to wait a little longer.
                        Thread.Sleep(TimeSpan.FromSeconds(10d));
                    } while (true);
                }
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage += "An error occurred during deletion. Your SNS queue may be deleted, but we were unable to verify. Please check your AWS Console.";
                deprovisionResult.EndUserMessage += e.Message;
            }
            return(deprovisionResult);
        }
Ejemplo n.º 20
0
 public override OperationResult Deprovision(AddonDeprovisionRequest request)
 {
     /*The Deprovision method allows you to specify the steps taken when a developer deprovisions his/her Add-On.
      * You should use this step to clean up any provisioned artifacts. The connectiondata object inside the request should
      * have all the information needed to clean up the provisioned resource.
      * At the end, you can return whether the operation was successful or not as shown in the sample below*/
     return(new OperationResult {
         EndUserMessage = "The Add-On was deprovisioned successfully", IsSuccess = true
     });
 }
Ejemplo n.º 21
0
 public void SetupManifest()
 {
     ProvisionRequest = new AddonProvisionRequest {
         Manifest = SetupPropertiesAndParameters()
     };
     DeprovisionRequest = new AddonDeprovisionRequest {
         Manifest = SetupPropertiesAndParameters()
     };
     TestRequest = new AddonTestRequest {
         Manifest = SetupPropertiesAndParameters()
     };
 }
Ejemplo n.º 22
0
        public RabbitMQConfig(AddonDeprovisionRequest request)
        {
            Hostname = request.Manifest.Properties.Single(p => p.Key == RabbitEndpointKey).Value;
            var portString = request.Manifest.Properties.Single(p => p.Key == RabbitPortKey).Value;

            Port = int.Parse(portString);
            var adminPortString = request.Manifest.Properties.Single(p => p.Key == RabbitAdminPortKey).Value;

            AdminPort     = int.Parse(adminPortString);
            AdminUser     = request.Manifest.Properties.Single(p => p.Key == RabbitAdminUserKey).Value;
            AdminPassword = request.Manifest.Properties.Single(p => p.Key == RabbitAdminPasswordKey).Value;
        }
Ejemplo n.º 23
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var           deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest          = request.Manifest;
            string        devOptions        = request.DeveloperOptions;

            try
            {
                AmazonS3Client client;
                var            conInfo          = ConnectionInfo.Parse(connectionData);
                var            developerOptions = S3DeveloperOptions.Parse(devOptions);
                // heh, need to know which bucket to remove...
                developerOptions.BucketName = conInfo.BucketName;

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return(deprovisionResult);
                }

                var response =
                    client.DeleteBucket(new DeleteBucketRequest
                {
                    BucketName = developerOptions.BucketName
                });
                // 5/22/14 fixing amazon aws deprecation
                if (response.HttpStatusCode.Equals(HttpStatusCode.OK))
                {
                    var verificationResponse = client.ListBuckets(new ListBucketsRequest());
                    // 5/22/14 fixing amazaon aws deprecration
                    if (verificationResponse.Buckets.All(x => x.BucketName != conInfo.BucketName))
                    {
                        deprovisionResult.IsSuccess      = true;
                        deprovisionResult.EndUserMessage = "Successfully deleted bucket: " + conInfo.BucketName;
                    }
                }
                else
                {
                    // error occurred during deletion
                    deprovisionResult.EndUserMessage = "Error during deprovision. Check S3 to ensure bucket was deleted.";
                }
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message + e.StackTrace;
            }

            return(deprovisionResult);
        }
Ejemplo n.º 24
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            string connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            AddonManifest manifest = request.Manifest;
            string devOptions = request.DeveloperOptions;

            try
            {
                AmazonS3Client client;
                var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = S3DeveloperOptions.Parse(devOptions);
                // heh, need to know which bucket to remove...
                developerOptions.BucketName = conInfo.BucketName;

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return deprovisionResult;
                }

                var response =
                    client.DeleteBucket(new DeleteBucketRequest
                    {
                        BucketName = developerOptions.BucketName
                    });
                // 5/22/14 fixing amazon aws deprecation
                if (response.HttpStatusCode.Equals(HttpStatusCode.OK))
                {
                    var verificationResponse = client.ListBuckets(new ListBucketsRequest());
                    // 5/22/14 fixing amazaon aws deprecration
                    if (verificationResponse.Buckets.All(x => x.BucketName != conInfo.BucketName))
                    {
                        deprovisionResult.IsSuccess = true;
                        deprovisionResult.EndUserMessage = "Successfully deleted bucket: " + conInfo.BucketName;
                    }
                }
                else
                {
                    // error occurred during deletion
                    deprovisionResult.EndUserMessage = "Error during deprovision. Check S3 to ensure bucket was deleted.";
                }
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message + e.StackTrace;
            }

            return deprovisionResult;
        }
Ejemplo n.º 25
0
        public void TestProvisioningMethods()
        {
            var request    = new AddonProvisionRequest();
            var properties = new List <AddonProperty>();

            properties.Add(new AddonProperty()
            {
                Key = "RabbitEndpoint", Value = "hqs-engineer15.apprendalabs.local"
            });
            properties.Add(new AddonProperty()
            {
                Key = "RabbitAdminPort", Value = "15672"
            });
            properties.Add(new AddonProperty()
            {
                Key = "RabbitPort", Value = "5672"
            });
            properties.Add(new AddonProperty()
            {
                Key = "RabbitAdminUser", Value = "guest"
            });
            properties.Add(new AddonProperty()
            {
                Key = "RabbitAdminPassword", Value = "guest"
            });
            properties.Add(new AddonProperty()
            {
                Key = "DeveloperAlias", Value = "unit"
            });
            properties.Add(new AddonProperty()
            {
                Key = "InstanceAlias", Value = "sampleId"
            });

            request.Manifest            = ReadTestManifest("UnitTestAddOnManifest.xml");
            request.Manifest.Properties = properties;

            var addon  = new RabbitMQAddOn.RabbitMQAddOn();
            var result = addon.Provision(request);

            Assert.IsTrue(result.IsSuccess);

            var deprovisionRequest = new AddonDeprovisionRequest();

            deprovisionRequest.Manifest            = ReadTestManifest("UnitTestAddOnManifest.xml");
            deprovisionRequest.Manifest.Properties = properties;

            var deprovisionResult = addon.Deprovision(deprovisionRequest);

            Assert.IsTrue(deprovisionResult.IsSuccess);
        }
Ejemplo n.º 26
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var deprovisionResult  = new ProvisionAddOnResult(connectionData);
            var manifest           = request.Manifest;
            var inputDevParameters = request.DeveloperParameters;
            // parse required options here, use developer options class to do so.
            var manifestProperties = manifest.GetProperties();
            // Developer Options will be instantiated first time here.
            var devParams = DeveloperParameters.Parse(inputDevParameters, manifestProperties);

            // set up the credentials for azure
            var creds = CertificateAuthenticationHelper.GetCredentials(devParams.AzureManagementSubscriptionId,
                                                                       devParams.AzureAuthenticationKey);
            // set up the storage management client
            var client = new StorageManagementClient();

            var mResponse = client.StorageAccounts.Delete(devParams.StorageAccountName);

            if (mResponse.StatusCode.Equals(HttpStatusCode.OK))
            {
                do
                {
                    var verificationResponse =
                        client.StorageAccounts.Get(devParams.StorageAccountName);

                    if (verificationResponse.StorageAccount.Properties.Status.Equals(StorageAccountStatus.Deleting))
                    {
                        deprovisionResult.IsSuccess      = true;
                        deprovisionResult.EndUserMessage =
                            "Deprovision Request Complete, please allow a few minutes for resources to be fully deleted.";
                        break;
                    }
                    Thread.Sleep(TimeSpan.FromSeconds(10d));
                } while (true);
                return(deprovisionResult);
            }
            else
            {
                return(new OperationResult()
                {
                    EndUserMessage = "Azure Query failed. Please check your syntax and credetials.",
                    IsSuccess = false
                });
            }
        }
Ejemplo n.º 27
0
        public static void TestSuccessfulDeProvisioning()
        {
            var addon    = new Addon();
            var manifest = GetAWSAddonManifest();

            manifest.Properties.First(p => p.Key == "requireDevCredentials").Value = "false";
            manifest.ProvisioningUsername = awsAccessKey;
            manifest.ProvisioningPassword = awsSecretKey;

            var request = new AddonDeprovisionRequest {
                Manifest = manifest, DeveloperOptions = "DbInstanceIdentifier=db2"
            };

            var result = addon.Deprovision(request);

            Assert.IsTrue(result.IsSuccess, result.EndUserMessage);
        }
Ejemplo n.º 28
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var connectionData = request.ConnectionData;
            // changing to overloaded constructor - 5/22/14
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            var manifest = request.Manifest;
            var inputDevParameters = request.DeveloperParameters;
            // parse required options here, use developer options class to do so.
            var manifestProperties = manifest.GetProperties();
            // Developer Options will be instantiated first time here.
            var devParams = DeveloperParameters.Parse(inputDevParameters, manifestProperties);

            // set up the credentials for azure
            var creds = CertificateAuthenticationHelper.GetCredentials(devParams.AzureManagementSubscriptionId,
                    devParams.AzureAuthenticationKey);
            // set up the storage management client
            var client = new StorageManagementClient();

            var mResponse = client.StorageAccounts.Delete(devParams.StorageAccountName);
            if (mResponse.StatusCode.Equals(HttpStatusCode.OK))
            {
                do
                {
                    var verificationResponse =
                        client.StorageAccounts.Get(devParams.StorageAccountName);

                    if (verificationResponse.StorageAccount.Properties.Status.Equals(StorageAccountStatus.Deleting))
                    {
                        deprovisionResult.IsSuccess = true;
                        deprovisionResult.EndUserMessage =
                            "Deprovision Request Complete, please allow a few minutes for resources to be fully deleted.";
                        break;
                    }
                    Thread.Sleep(TimeSpan.FromSeconds(10d));
                } while (true);
                return deprovisionResult;
            }
            else
            {
                return new OperationResult()
                {
                    EndUserMessage = "Azure Query failed. Please check your syntax and credetials.",
                    IsSuccess = false
                };
            }
        }
Ejemplo n.º 29
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var rabbitConfig = new RabbitMQConfig(request);
            var client       = new RestClient(rabbitConfig.ManagementUri);

            client.Authenticator = new HttpBasicAuthenticator(rabbitConfig.AdminUser, rabbitConfig.AdminPassword);

            // Delete vhost
            var vhostName          = request.Manifest.CallingDeveloperAlias + "_" + request.Manifest.InstanceAlias;
            var deleteVhostPath    = $"vhosts/{vhostName}";
            var deleteVhostRequest = new RestRequest(deleteVhostPath, Method.DELETE)
            {
                RequestFormat = DataFormat.Json
            };

            deleteVhostRequest.AddHeader("content-type", "application/json");

            var deleteVhostResponse = client.Execute(deleteVhostRequest);

            if (deleteVhostResponse.ResponseStatus != ResponseStatus.Completed)
            {
                return(ProvisionAddOnResult.Failure("Unable to delete vhost"));
            }

            // Delete user
            var user = request.Manifest.CallingDeveloperAlias + "_" + request.Manifest.InstanceAlias;

            var deleteUserPath = $"users/{user}";

            var deleteUserRequest = new RestRequest(deleteUserPath, Method.DELETE)
            {
                RequestFormat = DataFormat.Json
            };

            deleteUserRequest.AddHeader("content-type", "application/json");

            var deleteUserResponse = client.Execute(deleteUserRequest);

            if (deleteUserResponse.ResponseStatus != ResponseStatus.Completed)
            {
                return(ProvisionAddOnResult.Failure("Unable to delete user"));
            }

            return(ProvisionAddOnResult.Success("RabbitMQ Addon Instance Deprovisioned Successfully"));
        }
 // Deprovision NetApp
 // Input: AddonDeprovisionRequest request
 // Output: OperationResult
 public override OperationResult Deprovision(AddonDeprovisionRequest request)
 {
     var deprovisionResult = new OperationResult {IsSuccess = false};
     try
     {
         // this loads in the developer options and the manifest parameters
         // validation will also occur here, so if this fails it will be caught prior to any invocation on the cluster.
         var developerOptions = DeveloperParameters.Parse(request.DeveloperParameters, request.Manifest);
         // for assumptions now, delete a volume
         var netappresponse = NetAppFactory.DeleteVolume(developerOptions, request.ConnectionData);
         // use the class's conversion method.
         return netappresponse.ToOperationResult();
     }
     catch (Exception e)
     {
         deprovisionResult.EndUserMessage = e.Message;
     }
     return deprovisionResult;
 }
Ejemplo n.º 31
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var deprovisionResult = new ProvisionAddOnResult("")
            {
                IsSuccess = true
            };

            deprovisionResult.ConnectionData = "deprovision";
            AddonManifest manifest       = request.Manifest;
            string        connectionData = request.ConnectionData;
            string        devOptions     = request.DeveloperOptions;

            //string jobid = null;

            try
            {
                IAmazonElasticMapReduce client;
                //var conInfo = ConnectionInfo.Parse(connectionData);
                var developerOptions = EMRDeveloperOptions.Parse(devOptions);

                var establishClientResult = EstablishClient(manifest, developerOptions, out client);
                if (!establishClientResult.IsSuccess)
                {
                    deprovisionResult.EndUserMessage = establishClientResult.EndUserMessage;
                    return(deprovisionResult);
                }

                var result = client.TerminateJobFlows(new TerminateJobFlowsRequest()
                {
                    JobFlowIds = { connectionData }
                });

                deprovisionResult.IsSuccess      = true;
                deprovisionResult.EndUserMessage = "EMR Cluster Termination Request Successfully Invoked.";
            }
            catch (Exception)
            {
                deprovisionResult.EndUserMessage = "An error occurred during deprovisioning, please check the SOC logs for further assistance.";
            }

            return(deprovisionResult);
        }
Ejemplo n.º 32
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            return(Task.Run(async() =>
            {
                try
                {
                    await new Logic(request.Manifest).DeprovisionVolume(request.Manifest.InstanceAlias);

                    return new OperationResult {
                        IsSuccess = true
                    };
                }
                catch (Exception ex)
                {
                    return new OperationResult {
                        EndUserMessage = $"Error deprovisioning Kubernetes volume: {ex}"
                    };
                }
            }).GetAwaiter().GetResult());
        }
Ejemplo n.º 33
0
        public override OperationResult Deprovision(AddonDeprovisionRequest _request)
        {
            var result = new OperationResult()
            {
                IsSuccess = false
            };
            string port;

            try
            {
                port = _request.Manifest.Properties.Find(_x => _x.Key.Equals("port")).Value;
            }
            catch (ArgumentNullException)
            {
                port = "27017";
            }
            try
            {
                var parameters       = DeveloperParameters.Parse(_request.DeveloperParameters, _request.Manifest.Properties);
                var connectionString = _request.ConnectionData;
                var client           = new MongoClient(connectionString);
                var name             = GetDatabaseName(_request.Manifest, parameters);
                var db = client.GetDatabase(name);
                client.DropDatabase(name);
                var drop = DropUser(parameters.Username);
                db.RunCommand <BsonDocument>(drop);
                result.IsSuccess = true;
            }
            catch (MongoException mongoException)
            {
                Logger.ErrorFormat("Error occurred during deprovisioning: {0} \n {1}", mongoException.Message, mongoException.StackTrace);
                result.EndUserMessage = mongoException.Message;
            }
            catch (Exception mongoException)
            {
                Logger.ErrorFormat("Error occurred during deprovisioning: {0} \n {1}", mongoException.Message, mongoException.StackTrace);
                result.EndUserMessage = mongoException.Message;
            }

            return(result);
        }
        public override OperationResult Deprovision(AddonDeprovisionRequest _request)
        {
            /*The Deprovision method allows you to specify the steps taken when a developer deprovisions his/her Add-On.
             * You should use this step to clean up any provisioned artifacts. The connectiondata object inside the request should
             * have all the information needed to clean up the provisioned resource.
             * At the end, you can return whether the operation was successful or not as shown in the sample below*/

            var deprovisionResult = new OperationResult {
                EndUserMessage = string.Empty, IsSuccess = false
            };

            var manifest      = _request.Manifest;
            var devParameters = _request.DeveloperParameters;
            var devOptions    = WCDeveloperOptions.Parse(devParameters, manifest);

            cloud_url = devOptions.cloudurl;

            try
            {
                var token  = authenticate(devOptions.apprendausername, devOptions.apprendapassword, devOptions.apprendatenant);
                int status = deleteApp(token, devOptions.alias);
                if (status == 204)
                {
                    log.Info("WatsonConversationAddon Deprovisioned Successfully");
                }
                else
                {
                    throw new Exception("Failed to deprovision");
                }
            }
            catch (Exception ex)
            {
                var errorMessage = string.Format("WatsonConversationAddon Deprovision Error: {0}\n{1}", ex, ex.StackTrace);
                log.Error(errorMessage);
                deprovisionResult.EndUserMessage = errorMessage;
                return(deprovisionResult);
            }

            deprovisionResult.IsSuccess = true;
            return(deprovisionResult);
        }
Ejemplo n.º 35
0
        // Deprovision NetApp
        // Input: AddonDeprovisionRequest request
        // Output: OperationResult
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var deprovisionResult = new OperationResult {
                IsSuccess = false
            };

            try
            {
                // this loads in the developer options and the manifest parameters
                // validation will also occur here, so if this fails it will be caught prior to any invocation on the cluster.
                var developerOptions = DeveloperParameters.Parse(request.DeveloperParameters, request.Manifest);
                // for assumptions now, delete a volume
                var netappresponse = NetAppFactory.DeleteVolume(developerOptions, request.ConnectionData);
                // use the class's conversion method.
                return(netappresponse.ToOperationResult());
            }
            catch (Exception e)
            {
                deprovisionResult.EndUserMessage = e.Message;
            }
            return(deprovisionResult);
        }
Ejemplo n.º 36
0
        public override OperationResult Deprovision(AddonDeprovisionRequest request)
        {
            var connectionData    = request.ConnectionData;
            var deprovisionResult = new ProvisionAddOnResult(connectionData);
            var devOptions        = DeveloperParameters.Parse(request.DeveloperParameters, request.Manifest.GetProperties());
            // set up the credentials for azure
            SubscriptionCloudCredentials creds = CertificateAuthenticationHelper.GetCredentials(devOptions.AzureManagementSubscriptionId, devOptions.AzureAuthenticationKey, devOptions.PFXPassword);
            // set up the storage management client
            var client = new StorageManagementClient(creds);

            // check to see if the storage accounts exists...if they do not exist, throw a no-op here.
            var account = client.StorageAccounts.Get(devOptions.StorageAccountName);

            if (account.StatusCode.Equals(HttpStatusCode.NotFound))
            {
                // no account found. return a no-op as something went wrong, proceed to deletion
                deprovisionResult.IsSuccess      = true;
                deprovisionResult.EndUserMessage = "Storage account not found, may have been deleted via 3rd party.";
                return(deprovisionResult);
            }

            // then if requested, delete the storage account name
            client.StorageAccounts.Delete(devOptions.StorageAccountName);

            do
            {
                var verificationResponse = client.StorageAccounts.Get(devOptions.StorageAccountName);

                if (verificationResponse.StorageAccount.Properties.Status.Equals(StorageAccountStatus.Deleting))
                {
                    deprovisionResult.IsSuccess      = true;
                    deprovisionResult.EndUserMessage = "Deprovision Request Complete, please allow a few minutes for resources to be fully deleted.";
                    break;
                }
                Thread.Sleep(TimeSpan.FromSeconds(10d));
            }while (true);
            return(deprovisionResult);
        }
Ejemplo n.º 37
0
 public override OperationResult Deprovision(AddonDeprovisionRequest request)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 38
0
 // The first three methods here will need to be overridden. I've extended to add some utility classes that are non-component specific.
 // Deprovision Action
 // Input: AddonDeprovisionRequest
 // Output: OpertaionResult
 public abstract override OperationResult Deprovision(AddonDeprovisionRequest request);
Ejemplo n.º 39
0
 public void SetupManifest()
 {
     ProvisionRequest = new AddonProvisionRequest {Manifest = SetupPropertiesAndParameters()};
     DeprovisionRequest = new AddonDeprovisionRequest {Manifest = SetupPropertiesAndParameters()};
     TestRequest = new AddonTestRequest {Manifest = SetupPropertiesAndParameters()};
 }
 /// <summary>
 /// Deprovision the Syslog endpoint - which is a null operation, as such endpoints are external resources which are not allocated per-instance.
 /// </summary>
 /// <param name="request">The deprovisioning request details from the developer portal</param>
 /// <returns>Always succeeds - null operation</returns>
 public override OperationResult Deprovision(AddonDeprovisionRequest request)
 {
     return(SuccessResult("The Syslog addon was deprovisioned successfully."));
 }
Ejemplo n.º 41
0
        // The first three methods here will need to be overridden. I've extended to add some utility classes that are non-component specific.

        // Deprovision Action
        // Input: AddonDeprovisionRequest
        // Output: OpertaionResult
        public abstract override OperationResult Deprovision(AddonDeprovisionRequest request);