Aliyun Python CreateInstance - cannot create with Internet IP Address Unicorn Meta Zoo #1: Why...

What *exactly* is electrical current, voltage, and resistance?

Map material from china not allowed to leave the country

Is Diceware more secure than a long passphrase?

Raising a bilingual kid. When should we introduce the majority language?

Second order approximation of the loss function (Deep learning book, 7.33)

Do I need to protect SFP ports and optics from dust/contaminants? If so, how?

Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?

How to count in linear time worst-case?

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

A Paper Record is What I Hamper

All ASCII characters with a given bit count

What to do with someone that cheated their way through university and a PhD program?

A strange hotel

Trumpet valves, lengths, and pitch

Is a 5 watt UHF/VHF handheld considered QRP?

Need of separate security plugins for both root and subfolder sites Wordpress?

How to keep bees out of canned beverages?

What is this word supposed to be?

PIC mathematical operations weird problem

Expansion//Explosion and Siren Stormtamer

Is it acceptable to use working hours to read general interest books?

Suing a Police Officer Instead of the Police Department

Putting Ant-Man on house arrest

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?



Aliyun Python CreateInstance - cannot create with Internet IP Address



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Come Celebrate our 10 Year Anniversary!Compile Python 3.1.1 with --enable-sharedHow do I list the files associated with a Python package installed using pip or easy_install?upgrading pythonPython command to create no-arch rpm'sHow to create Python (2.7.3) RPM package?Using collectd with Python 3Jenkins : Python script with argumentsCannot install python-libs package on AWSUnable to create read-only instances on ApsaraDB for RDS?Unable to create ECS Instance in Dubai Region?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I've pip-installed these 3 Python pkgs:




  • aliyun-python-sdk-core

  • aliyun-python-sdk-ecs

  • aliyun-python-sdk-vpc


Trying to CreateInstance with an external (Internet) IP address but everytime I only get Private IP address. How to CreateInstance with external-facing, internet IP address? When I run 'DescribeInstances' I get response of 'VpcAttributes' but how to set 'VpcAttributes' in CreateInstance as there's no such function in the SDK's CreateInstance.py?



Script:



import json
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
from aliyunsdkecs.request.v20140526.DescribeUserDataRequest import DescribeUserDataRequest
from aliyunsdkecs.request.v20140526.CreateInstanceRequest import CreateInstanceRequest
from aliyunsdkecs.request.v20140526.StartInstanceRequest import StartInstanceRequest

# Create an AcsClient instance
client = AcsClient(
"LTblahaccesskey", ## your-access-key-id
"bGkeysecret", ## your-access-key-secret
"us-east-1") ## your-region-id

# Create an instance
request = CreateInstanceRequest()
request.set_accept_format('json')
request.set_ImageId("m-rjmyImageId838")
request.set_InstanceName("myTestInstance")
request.set_SecurityGroupId("sg-rmysecgroupid")
request.set_InstanceType("ecs.sn2ne.large")
request.set_KeyPairName("myKey")
request.set_InternetChargeType("PayByTraffic")
request.set_VSwitchId("vsw-rjmyswitchid")
request.set_InternetMaxBandwidthOut(5)
request.set_UserData("Zm9vOmJhcg==")

response = client.do_action_with_exception(request)
parsed = json.loads(response)
print(json.dumps(parsed, indent=3))
myInstanceId = parsed['InstanceId']
print('Instance Created: ', myInstanceId)








share







New contributor




Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I've pip-installed these 3 Python pkgs:




    • aliyun-python-sdk-core

    • aliyun-python-sdk-ecs

    • aliyun-python-sdk-vpc


    Trying to CreateInstance with an external (Internet) IP address but everytime I only get Private IP address. How to CreateInstance with external-facing, internet IP address? When I run 'DescribeInstances' I get response of 'VpcAttributes' but how to set 'VpcAttributes' in CreateInstance as there's no such function in the SDK's CreateInstance.py?



    Script:



    import json
    from aliyunsdkcore.client import AcsClient
    from aliyunsdkcore.acs_exception.exceptions import ClientException
    from aliyunsdkcore.acs_exception.exceptions import ServerException
    from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
    from aliyunsdkecs.request.v20140526.DescribeUserDataRequest import DescribeUserDataRequest
    from aliyunsdkecs.request.v20140526.CreateInstanceRequest import CreateInstanceRequest
    from aliyunsdkecs.request.v20140526.StartInstanceRequest import StartInstanceRequest

    # Create an AcsClient instance
    client = AcsClient(
    "LTblahaccesskey", ## your-access-key-id
    "bGkeysecret", ## your-access-key-secret
    "us-east-1") ## your-region-id

    # Create an instance
    request = CreateInstanceRequest()
    request.set_accept_format('json')
    request.set_ImageId("m-rjmyImageId838")
    request.set_InstanceName("myTestInstance")
    request.set_SecurityGroupId("sg-rmysecgroupid")
    request.set_InstanceType("ecs.sn2ne.large")
    request.set_KeyPairName("myKey")
    request.set_InternetChargeType("PayByTraffic")
    request.set_VSwitchId("vsw-rjmyswitchid")
    request.set_InternetMaxBandwidthOut(5)
    request.set_UserData("Zm9vOmJhcg==")

    response = client.do_action_with_exception(request)
    parsed = json.loads(response)
    print(json.dumps(parsed, indent=3))
    myInstanceId = parsed['InstanceId']
    print('Instance Created: ', myInstanceId)








    share







    New contributor




    Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I've pip-installed these 3 Python pkgs:




      • aliyun-python-sdk-core

      • aliyun-python-sdk-ecs

      • aliyun-python-sdk-vpc


      Trying to CreateInstance with an external (Internet) IP address but everytime I only get Private IP address. How to CreateInstance with external-facing, internet IP address? When I run 'DescribeInstances' I get response of 'VpcAttributes' but how to set 'VpcAttributes' in CreateInstance as there's no such function in the SDK's CreateInstance.py?



      Script:



      import json
      from aliyunsdkcore.client import AcsClient
      from aliyunsdkcore.acs_exception.exceptions import ClientException
      from aliyunsdkcore.acs_exception.exceptions import ServerException
      from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
      from aliyunsdkecs.request.v20140526.DescribeUserDataRequest import DescribeUserDataRequest
      from aliyunsdkecs.request.v20140526.CreateInstanceRequest import CreateInstanceRequest
      from aliyunsdkecs.request.v20140526.StartInstanceRequest import StartInstanceRequest

      # Create an AcsClient instance
      client = AcsClient(
      "LTblahaccesskey", ## your-access-key-id
      "bGkeysecret", ## your-access-key-secret
      "us-east-1") ## your-region-id

      # Create an instance
      request = CreateInstanceRequest()
      request.set_accept_format('json')
      request.set_ImageId("m-rjmyImageId838")
      request.set_InstanceName("myTestInstance")
      request.set_SecurityGroupId("sg-rmysecgroupid")
      request.set_InstanceType("ecs.sn2ne.large")
      request.set_KeyPairName("myKey")
      request.set_InternetChargeType("PayByTraffic")
      request.set_VSwitchId("vsw-rjmyswitchid")
      request.set_InternetMaxBandwidthOut(5)
      request.set_UserData("Zm9vOmJhcg==")

      response = client.do_action_with_exception(request)
      parsed = json.loads(response)
      print(json.dumps(parsed, indent=3))
      myInstanceId = parsed['InstanceId']
      print('Instance Created: ', myInstanceId)








      share







      New contributor




      Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I've pip-installed these 3 Python pkgs:




      • aliyun-python-sdk-core

      • aliyun-python-sdk-ecs

      • aliyun-python-sdk-vpc


      Trying to CreateInstance with an external (Internet) IP address but everytime I only get Private IP address. How to CreateInstance with external-facing, internet IP address? When I run 'DescribeInstances' I get response of 'VpcAttributes' but how to set 'VpcAttributes' in CreateInstance as there's no such function in the SDK's CreateInstance.py?



      Script:



      import json
      from aliyunsdkcore.client import AcsClient
      from aliyunsdkcore.acs_exception.exceptions import ClientException
      from aliyunsdkcore.acs_exception.exceptions import ServerException
      from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
      from aliyunsdkecs.request.v20140526.DescribeUserDataRequest import DescribeUserDataRequest
      from aliyunsdkecs.request.v20140526.CreateInstanceRequest import CreateInstanceRequest
      from aliyunsdkecs.request.v20140526.StartInstanceRequest import StartInstanceRequest

      # Create an AcsClient instance
      client = AcsClient(
      "LTblahaccesskey", ## your-access-key-id
      "bGkeysecret", ## your-access-key-secret
      "us-east-1") ## your-region-id

      # Create an instance
      request = CreateInstanceRequest()
      request.set_accept_format('json')
      request.set_ImageId("m-rjmyImageId838")
      request.set_InstanceName("myTestInstance")
      request.set_SecurityGroupId("sg-rmysecgroupid")
      request.set_InstanceType("ecs.sn2ne.large")
      request.set_KeyPairName("myKey")
      request.set_InternetChargeType("PayByTraffic")
      request.set_VSwitchId("vsw-rjmyswitchid")
      request.set_InternetMaxBandwidthOut(5)
      request.set_UserData("Zm9vOmJhcg==")

      response = client.do_action_with_exception(request)
      parsed = json.loads(response)
      print(json.dumps(parsed, indent=3))
      myInstanceId = parsed['InstanceId']
      print('Instance Created: ', myInstanceId)






      python alibaba-cloud





      share







      New contributor




      Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 56 secs ago









      Linda ChauLinda Chau

      1




      1




      New contributor




      Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Linda Chau is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Linda Chau is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964488%2faliyun-python-createinstance-cannot-create-with-internet-ip-address%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Linda Chau is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Linda Chau is a new contributor. Be nice, and check out our Code of Conduct.













          Linda Chau is a new contributor. Be nice, and check out our Code of Conduct.












          Linda Chau is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964488%2faliyun-python-createinstance-cannot-create-with-internet-ip-address%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Фонтен-ла-Гаярд Зміст Демографія | Економіка | Посилання |...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Маріан Котлеба Зміст Життєпис | Політичні погляди |...