Exemplo n.º 1
0
        protected void Authenticate(AbstractRequest request)
        {
            MonoscapeCredentials requestCredentials = request.Credentials;

            if ((requestCredentials == null) || (!requestCredentials.AccessKey.Equals(Credentials.AccessKey)) || (!requestCredentials.SecretKey.Equals(Credentials.SecretKey)))
            {
                Log.Error(this, "Monoscape request authentication failed!");
                throw new MonoscapeSecurityException("Invalid Monoscape credentials");
            }
            Log.Debug(this, "Monoscape request authenticated");
        }
Exemplo n.º 2
0
        private string FindInstanceId(string ipAddress)
        {
            try
            {
                ApDashboardService          service     = new ApDashboardService();
                MonoscapeCredentials        credentials = new MonoscapeCredentials(Settings.MonoscapeAccessKey, Settings.MonoscapeSecretKey);
                ApDescribeInstancesRequest  request     = new ApDescribeInstancesRequest(credentials);
                ApDescribeInstancesResponse response    = service.DescribeInstances(request);

                foreach (Instance instance in response.Instances)
                {
                    if (instance.IpAddress.Equals(ipAddress))
                    {
                        return(instance.InstanceId);
                    }
                }
            }
            catch (Exception)
            {
                Log.Error(this, "Could not find Instance ID of " + ipAddress);
            }
            return(null);
        }
Exemplo n.º 3
0
        private void SubscribeToApplicationGrid()
        {
            try
            {
                Console.WriteLine("Subscribing to Application Grid at: " + Settings.ApplicationGridEndPointURL);

                MonoscapeCredentials   credentials = new MonoscapeCredentials(Settings.MonoscapeAccessKey, Settings.MonoscapeSecretKey);
                ApSubscribeNodeRequest request     = new ApSubscribeNodeRequest(credentials);
                IPAddress hostIp = MonoscapeUtil.FindHostIpAddress();
                request.IpAddress  = hostIp.ToString();
                request.IpAddress_ = hostIp;
                request.ApplicationGridServiceUrl = Settings.ApplicationGridServiceUrl;
                request.FileTransferServiceUrl    = Settings.FileServerServiceUrl + "/wsHttp";
                IApNodeControllerService channel  = EndPoints.GetApNodeControllerService();
                ApSubscribeNodeResponse  response = channel.SubscribeNode(request);
                Database.Node = response.Node;

                Console.WriteLine("Subscribed successfully");
            }
            catch (EndpointNotFoundException e)
            {
                throw new MonoscapeException("Could not connect to the Application Grid", e);
            }
        }
Exemplo n.º 4
0
 public ApAssociateAddressRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
 public ApTerminateInstanceRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
 public LbRemoveRequestFromQueueRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 7
0
 public ApDescribeScalingHistoryRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 8
0
 public ApGetConfigurationSettingsRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 9
0
 public ApAddApplicationRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 10
0
 public ApStopApplicationInstanceRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 11
0
 public ApSubscribeNodeRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 12
0
 public LbGetRequestCountRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 13
0
 public CcRemoveSubscriptionRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 14
0
 public ApDescribeAddressesRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 15
0
 public LbGetRoutingMeshRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
 public LbGetApplicationScaleRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 17
0
 public ApAuthorizeRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 18
0
 public LbGetRequestQueueRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 19
0
 public ApRunInstancesRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
 public LbAddApplicationInstancesRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
 public NcDescribeApplicationsRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 22
0
 public ApDescribeNodesRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 23
0
 public ApplicationExistsRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 24
0
 public LbAddRequestToQueueRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 25
0
 public ApRebootInstanceRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
 public NcStartApplicationInstancesRequest(MonoscapeCredentials credentials) : base(credentials)
 {
 }
Exemplo n.º 27
0
 public ApDeregisterImageRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 28
0
 public LbRemoveApplicationInstanceRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 29
0
 public CcQuerySubscriptionsRequest(MonoscapeCredentials credentials)
     : base(credentials)
 {
 }
Exemplo n.º 30
0
 public NcStopApplicationRequest(MonoscapeCredentials credentials) : base(credentials)
 {
 }