• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NodeLocation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NodeLocation的典型用法代码示例。如果您正苦于以下问题:C# NodeLocation类的具体用法?C# NodeLocation怎么用?C# NodeLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NodeLocation类属于命名空间,在下文中一共展示了NodeLocation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateNode

 public override Node CreateNode(string name, NodeSize size, NodeImage image, NodeLocation location, NodeAuth auth, NodeOptions options)
 {
     LinodeNodeOptions ops = options as LinodeNodeOptions;
     if (ops == null && options != null)
         throw new Exception ("Only LinodeNodeOptions can be used as NodeOptions for creating Linode Nodes.");
     else if (ops == null)
         ops = new LinodeNodeOptions ();
     return API.CreateNode (name, size, image, location, auth, ops);
 }
开发者ID:jacksonh,项目名称:MCloud,代码行数:9,代码来源:LinodeDriver.cs


示例2: CreateNode

        public Node CreateNode(string name, NodeSize size, NodeImage image, NodeLocation location, NodeAuth auth, LinodeNodeOptions options)
        {
            int rsize = size.Disk - options.SwapSize;

            string kernel = FindKernel (options);

            LinodeRequest request = new LinodeRequest ("linode.create", new Dictionary<string,object> {
                {"DatacenterID", location.Id}, {"PlanID", size.Id},
                {"PaymentTerm", (int) options.PaymentTerm}});
            LinodeResponse response = Execute (request);

            JObject node = response.Data [0];
            string id = node ["LinodeID"].ToString ();

            string root_pass;
            if (auth.Type == NodeAuthType.Password)
                root_pass = auth.Secret;
            else
                root_pass = GenerateRandomPassword ();

            request = new LinodeRequest ("linode.disk.createfromdistribution", new Dictionary<string,object> {
                {"LinodeID", id}, {"DistributionID", image.Id}, {"Label", name}, {"Size", rsize},
                {"rootPass", root_pass}});

            if (auth.Type == NodeAuthType.SSHKey)
                request.Parameters.Add ("rootSSHKey", auth.Secret);

            response = Execute (request);

            JObject distro = response.Data [0];
            string root_disk = distro ["DiskID"].ToString ();

            request = new LinodeRequest ("linode.disk.create", new Dictionary<string,object> {
                {"LinodeID", id}, {"Label", "Swap"}, {"Type", "swap"}, {"Size", options.SwapSize}});
            response = Execute (request);

            string swap_disk = response.Data [0] ["DiskID"].ToString ();
            string disks = String.Format ("{0},{1},,,,,,,", root_disk, swap_disk);

            request = new LinodeRequest ("linode.config.create", new Dictionary<string,object> {
                {"LinodeID", id}, {"KernelID", kernel}, {"Label", "mcloud config"}, {"DiskList", disks}});
            response = Execute (request);

            string config = response.Data [0]["ConfigID"].ToString ();

            request = new LinodeRequest ("linode.boot", new Dictionary<string,object> {
                {"LinodeID", id}, {"ConfigID", config}});
            response = Execute (request);

            request = new LinodeRequest ("linode.list", new Dictionary<string,object> {{"LinodeID", id}});
            response = Execute (request);

            return LinodeNode.FromData (response.Data [0], driver);
        }
开发者ID:aggrata,项目名称:MCloud,代码行数:54,代码来源:LinodeAPI.cs


示例3: CreateNode

        public Node CreateNode(string name, NodeSize size, NodeImage image, NodeLocation location, int swap=128)
        {
            int rsize = size.Disk - swap;

            string kernel = FindKernel ();

            Console.WriteLine ("USING KERNEL:  {0}", kernel);

            LinodeRequest request = new LinodeRequest ("linode.create", new Dictionary<string,object> {
                {"DatacenterID", location.Id}, {"PlanID", size.Id},
                {"PaymentTerm", (int) driver.PaymentTerm}});
            LinodeResponse response = Execute (request);

            JObject node = response.Data [0];
            string id = node ["LinodeID"].ToString ();

            request = new LinodeRequest ("linode.disk.createfromdistribution", new Dictionary<string,object> {
                {"LinodeID", id}, {"DistributionID", image.Id}, {"Label", name}, {"Size", size.Disk},
                {"rootPass", "F23444sd"}});

            response = Execute (request);

            JObject distro = response.Data [0];
            string root_disk = distro ["DiskID"].ToString ();

            request = new LinodeRequest ("linode.disk.create", new Dictionary<string,object> {
                {"LinodeID", id}, {"Label", "Swap"}, {"Type", "swap"}, {"Size", swap}});
            response = Execute (request);

            string swap_disk = response.Data [0] ["DiskID"].ToString ();
            string disks = String.Format ("{0},{1},,,,,,,", root_disk, swap_disk);

            request = new LinodeRequest ("linode.config.create", new Dictionary<string,object> {
                {"LinodeID", id}, {"KernelID", kernel}, {"Label", "mcloud config"}, {"DiskList", disks}});
            response = Execute (request);

            string config = response.Data [0]["ConfigID"].ToString ();

            request = new LinodeRequest ("linode.boot", new Dictionary<string,object> {
                {"LinodeID", id}, {"ConfigID", config}});
            response = Execute (request);

            return null;
        }
开发者ID:kumpera,项目名称:MCloud,代码行数:44,代码来源:LinodeAPI.cs


示例4: CreateNode

        public override Node CreateNode(string name, NodeSize size, NodeImage image, NodeLocation location, NodeAuth auth, NodeOptions options)
        {
            EC2NodeOptions ops = options as EC2NodeOptions;
            if (ops == null && options != null)
                throw new Exception ("Only EC2NodeOptions can be used as NodeOptions for creating EC2 Nodes.");
            else if (ops == null)
                ops = new EC2NodeOptions ();

            RunInstancesRequest request = new RunInstancesRequest () {
                InstanceType = size.Id,
                ImageId = image.Id,
                MinCount = 1,
                MaxCount = 1,
                KeyName = auth.UserName,
            };
            RunInstancesResponse response = Client.RunInstances (request);

            foreach (var i in response.RunInstancesResult.Reservation.RunningInstance) {
                return EC2Node.FromRunningInstance (i, this);
            }

            return null;
        }
开发者ID:jacksonh,项目名称:MCloud,代码行数:23,代码来源:EC2Driver.cs


示例5: Element

 public Element Element(Combinator combinator, Node value, NodeLocation location)
 {
     return new Element(combinator, value) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例6: Directive

 public Directive Directive(string name, string identifier, NodeList rules, NodeLocation location)
 {
     return new Directive(name, identifier, rules) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例7: MixinDefinition

 public MixinDefinition MixinDefinition(string name, NodeList<Rule> parameters, NodeList rules, Condition condition, bool variadic, NodeLocation location)
 {
     return new MixinDefinition(name, parameters, rules, condition, variadic) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例8: Selector

 public Selector Selector(NodeList<Element> elements, NodeLocation location)
 {
     return new Selector(elements) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例9: KeyFrame

 public KeyFrame KeyFrame(string identifier, NodeList rules, NodeLocation location)
 {
     return new KeyFrame(identifier, rules) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例10: Media

 public Media Media(NodeList rules, Value features, NodeLocation location)
 {
     return new Media(features, rules) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例11: Assignment

 public Assignment Assignment(string key, Node value, NodeLocation location)
 {
     return new Assignment(key, value);
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例12: Call

 public Call Call(string name, NodeList<Node> arguments, NodeLocation location)
 {
     return new Call(name, arguments) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例13: Value

 public Value Value(IEnumerable<Node> values, string important, NodeLocation location)
 {
     return new Value(values, important) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例14: Variable

 public Variable Variable(string name, NodeLocation location)
 {
     return new Variable(name) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例15: Url

 public Url Url(Node value, IImporter importer, NodeLocation location)
 {
     return new Url(value, importer) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例16: TextNode

 public TextNode TextNode(string contents, NodeLocation location)
 {
     return new TextNode(contents) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例17: Shorthand

 public Shorthand Shorthand(Node first, Node second, NodeLocation location)
 {
     return new Shorthand(first, second) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例18: Expression

 public Expression Expression(NodeList expression, NodeLocation location)
 {
     return new Expression(expression) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例19: Color

 public Color Color(string rgb, NodeLocation location)
 {
     return new Color(rgb) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs


示例20: Import

 public Import Import(Quoted path, IImporter importer, Value features, bool isOnce, NodeLocation location)
 {
     return new Import(path, importer, features, isOnce) { Location = location };
 }
开发者ID:radleta,项目名称:dotless,代码行数:4,代码来源:DefaultNodeProvider.cs



注:本文中的NodeLocation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NodeMigrationData类代码示例发布时间:2022-05-24
下一篇:
C# NodeList类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap