/// <inheritdoc />
        protected override void ProcessRecord()
        {
            var client = ServiceFabricClientFactory.Create(new Uri(Endpoint));

            client.Cluster.GetClusterManifestAsync().GetAwaiter().GetResult();
            this.SessionState.PSVariable.Set(Constants.ClusterConnectionVariableName, client);
        }
Example #2
0
        static int Main(string[] args)
        {
            var parsedArguments = new ToolArguments();

            if (!CommandLineUtility.ParseCommandLineArguments(args, parsedArguments))
            {
                Console.Out.Write(CommandLineUtility.CommandLineArgumentsUsage(typeof(ToolArguments)));
                return(-1);
            }

            clusterUrl               = parsedArguments.clusterUrl;
            certLocation             = parsedArguments.certLocation;
            serverCertThumbprint     = parsedArguments.serverCertThumbprint;
            applicationName          = parsedArguments.appName;
            applicationFileLocation  = parsedArguments.applicationFileLocation;
            applicationFileLocation2 = parsedArguments.applicationFileLocation2;

            var settings = new ClientSettings(GetSecurityCredentials);
            IServiceFabricClient sfClient = ServiceFabricClientFactory.Create(new Uri(clusterConnectionUrl), settings);

            //check if the application exists first
            var applicationInfo = sfClient.ApplicationResources.GetApplicationResourceAsync(applicationName).GetAwaiter().GetResult();

            if (applicationInfo == null)
            {
                Console.Out.Write("Application does not exist");
                return(-1);
            }

            upgrade(sfClient);

            return(0);
        }
Example #3
0
 public SfContext(ITurnContext context) : base(context)
 {
     Client = ServiceFabricClientFactory.Create(new Uri("http://localhost:19080"));
 }