个人资料
个人介绍
这个人很懒,什么都没有留下
感兴趣或擅长的领域
暂无数据
达成规则
以上满足项可达成此勋章
他的回复:
[ec2-user@ip-10-219-14-8 ~]$ aws ec2 describe-instances helpDESCRIBE-INSTANCES() DESCRIBE-INSTANCES()NAME describe-instances -DESCRIPTION Describes the specified instances or all of AWS account's instances. If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the returned results. Recently terminated instances might appear in the returned results. This interval is usually less than one hour. If you describe instances in the rare case where an Availability Zone is experiencing a service disruption and you specify instance IDs that are in the affected zone, or do not specify any instance IDs at all, the call fails. If you describe instances and specify only instance IDs that are in an unaffected zone, the call works normally. See also: AWS API Documentation See 'aws help' for descriptions of global parameters. describe-instances is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument. When using --output text and the --query argument on a paginated response, the --query argument must extract data from the results of the following query expressions: ReservationsSYNOPSIS describe-instances [--filters ] [--instance-ids ] [--dry-run | --no-dry-run] [--cli-input-json ] [--starting-token ] [--page-size ] [--max-items ] [--generate-cli-skeleton ]OPTIONS --filters (list) The filters. o affinity - The affinity setting for an instance running on a Dedi- cated Host (default | host ). o architecture - The instance architecture (i386 | x86_64 | arm64 ). o availability-zone - The Availability Zone of the instance. o block-device-mapping.attach-time - The attach time for an EBS vol- ume mapped to the instance, for example, 2010-09-15T17:15:20.000Z . o block-device-mapping.delete-on-termination - A Boolean that indi- cates whether the EBS volume is deleted on instance termination. o block-device-mapping.device-name - The device name specified in the block device mapping (for example, /dev/sdh or xvdh ). o block-device-mapping.status - The status for the EBS volume (attaching | attached | detaching | detached ). o block-device-mapping.volume-id - The volume ID of the EBS volume. o client-token - The idempotency token you provided when you launched the instance. o dns-name - The public DNS name of the instance. o group-id - The ID of the security group for the instance. EC2-Classic only. o group-name - The name of the security group for the instance. EC2-Classic only. o hibernation-options.configured - A Boolean that indicates whether the instance is enabled for hibernation. A value of true means that the instance is enabled for hibernation. o host-id - The ID of the Dedicated Host on which the instance is running, if applicable. o hypervisor - The hypervisor type of the instance (ovm | xen ). The value xen is used for both Xen and Nitro hypervisors. o iam-instance-profile.arn - The instance profile associated with the instance. Specified as an ARN. o image-id - The ID of the image used to launch the instance. o instance-id - The ID of the instance. o instance-lifecycle - Indicates whether this is a Spot Instance or a Scheduled Instance (spot | scheduled ). o instance-state-code - The state of the instance, as a 16-bit unsigned integer. The high byte is used for internal purposes and should be ignored. The low byte is set based on the state repre- sented. The valid values are: 0 (pending), 16 (running), 32 (shut- ting-down), 48 (terminated), 64 (stopping), and 80 (stopped). o instance-state-name - The state of the instance (pending | running | shutting-down | terminated | stopping | stopped ). o instance-type - The type of instance (for example, t2.micro ). o instance.group-id - The ID of the security group for the instance. o instance.group-name - The name of the security group for the instance. o ip-address - The public IPv4 address of the instance. o kernel-id - The kernel ID. o key-name - The name of the key pair used when the instance was launched. o launch-index - When launching multiple instances, this is the index for the instance in the launch group (for example, 0, 1, 2, and so on). o launch-time - The time when the instance was launched. o metadata-options.http-tokens - The metadata request authorization state (optional | required ) o metadata-options.http-put-response-hop-limit - The http metadata request put response hop limit (integer, possible values 1 to 64 ) o metadata-options.http-endpoint - Enable or disable metadata access on http endpoint (enabled | disabled ) o monitoring-state - Indicates whether detailed monitoring is enabled (disabled | enabled ). o network-interface.addresses.private-ip-address - The private IPv4 address associated with the network interface. o network-interface.addresses.primary - Specifies whether the IPv4 address of the network interface is the primary private IPv4 address. o network-interface.addresses.association.public-ip - The ID of the association of an Elastic IP address (IPv4) with a network inter- face. o network-interface.addresses.association.ip-owner-id - The owner ID of the private IPv4 address associated with the network interface. o network-interface.association.public-ip - The address of the Elas- tic IP address (IPv4) bound to the network interface. o network-interface.association.ip-owner-id - The owner of the Elas- tic IP address (IPv4) associated with the network interface. o network-interface.association.allocation-id - The allocation ID returned when you allocated the Elastic IP address (IPv4) for your network interface. o network-interface.association.association-id - The association ID returned when the network interface was associated with an IPv4 address. o network-interface.attachment.attachment-id - The ID of the inter- face attachment. o network-interface.attachment.instance-id - The ID of the instance to which the network interface is attached. o network-interface.attachment.instance-owner-id - The owner ID of the instance to which the network interface is attached. o network-interface.attachment.device-index - The device index to which the network interface is attached. o network-interface.attachment.status - The status of the attachment (attaching | attached | detaching | detached ). o network-interface.attachment.attach-time - The time that the net- work interface was attached to an instance. o network-interface.attachment.delete-on-termination - Specifies whether the attachment is deleted when an instance is terminated. o network-interface.availability-zone - The Availability Zone for the network interface. o network-interface.description - The description of the network interface. o network-interface.group-id - The ID of a security group associated with the network interface. o network-interface.group-name - The name of a security group asso- ciated with the network interface. o network-interface.ipv6-addresses.ipv6-address - The IPv6 address associated with the network interface. o network-interface.mac-address - The MAC address of the network interface. o network-interface.network-interface-id - The ID of the network interface. o network-interface.owner-id - The ID of the owner of the network interface. o network-interface.private-dns-name - The private DNS name of the network interface. o network-interface.requester-id - The requester ID for the network interface. o network-interface.requester-managed - Indicates whether the net- work interface is being managed by AWS. o network-interface.status - The status of the network interface (available ) | in-use ). o network-interface.source-dest-check - Whether the network inter- face performs source/destination checking. A value of true means that checking is enabled, and false means that checking is dis- abled. The value must be false for the network interface to per- form network address translation (NAT) in your VPC. o network-interface.subnet-id - The ID of the subnet for the network interface. o network-interface.vpc-id - The ID of the VPC for the network interface. o owner-id - The AWS account ID of the instance owner. o placement-group-name - The name of the placement group for the instance. o placement-partition-number - The partition in which the instance is located. o platform - The platform. To list only Windows instances, use win- dows . o private-dns-name - The private IPv4 DNS name of the instance. o private-ip-address - The private IPv4 address of the instance. o product-code - The product code associated with the AMI used to launch the instance. o product-code.type - The type of product code (devpay | marketplace ). o ramdisk-id - The RAM disk ID. o reason - The reason for the current state of the instance (for example, shows "User Initiated [date]" when you stop or terminate the instance). Similar to the state-reason-code filter. o requester-id - The ID of the entity that launched the instance on your behalf (for example, AWS Management Console, Auto Scaling, and so on). o reservation-id - The ID of the instance's reservation. A reserva- tion ID is created any time you launch an instance. A reservation ID has a one-to-one relationship with an instance launch request, but can be associated with more than one instance if you launch multiple instances using the same launch request. For example, if you launch one instance, you get one reservation ID. If you launch ten instances using the same launch request, you also get one reservation ID. o root-device-name - The device name of the root device volume (for example, /dev/sda1 ). o root-device-type - The type of the root device volume (ebs | instance-store ). o source-dest-check - Indicates whether the instance performs source/destination checking. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform network address transla- tion (NAT) in your VPC. o spot-instance-request-id - The ID of the Spot Instance request. o state-reason-code - The reason code for the state change. o state-reason-message - A message that describes the state change. o subnet-id - The ID of the subnet for the instance. o tag :key- The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA , specify tag:Owner for the filter name and TeamA for the filter value. o tag-key - The key of a tag assigned to the resource. Use this fil- ter to find all resources that have a tag with a specific key, regardless of the tag value. o tenancy - The tenancy of an instance (dedicated | default | host ). o virtualization-type - The virtualization type of the instance (paravirtual | hvm ). o vpc-id - The ID of the VPC that the instance is running in. Shorthand Syntax: Name=string,Values=string,string ... JSON Syntax: [ { "Name": "string", "Values": ["string", ...] } ... ] --instance-ids (list) The instance IDs. Default: Describes all your instances. Syntax: "string" "string" ... --dry-run | --no-dry-run (boolean) Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRun- Operation . Otherwise, it is UnauthorizedOperation . --cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --gen- erate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. --starting-token (string) A token to specify where to start paginating. This is the NextToken from a previously truncated response. For usage examples, see Pagination in the AWS Command Line Interface User Guide . --page-size (integer) The size of each page to get in the AWS service call. This does not affect the number of items returned in the command's output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out. For usage examples, see Pagination in the AWS Command Line Interface User Guide . --max-items (integer) The total number of items to return in the command's output. If the total number of items available is more than the value specified, a NextToken is provided in the command's output. To resume pagination, provide the NextToken value in the starting-token argument of a sub- sequent command. Do not use the NextToken response element directly outside of the AWS CLI. For usage examples, see Pagination in the AWS Command Line Interface User Guide . --generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. See 'aws help' for descriptions of global parameters.EXAMPLES Example 1: To describe an Amazon EC2 instance The following describe-instances example displays details about the specified instance. aws ec2 describe-instances --instance-ids i-1234567890abcdef0 Example 2: To describe instances based on instance type The following describe-instances example displays details about only instances of the specified type. aws ec2 describe-instances --filters Name=instance-type,Values=m5.large Example 3: To describe instances based on tags The following describe-instances example displays details about only those instances that have a tag with the specified tag key (Owner), regardless of the tag value. aws ec2 describe-instances --filters "Name=tag-key,Values=Owner" The following describe-instances example displays details about only those instances that have a tag with the specified tag value (my-team), regardless of the tag key. aws ec2 describe-instances --filters "Name=tag-value,Values=my-team" The following describe-instances example displays details about only those instances that have the specified tag (Owner=my-team). aws ec2 describe-instances --filters "Name=tag:Owner,Values=my-team" Example 4: To filter the results based on multiple conditions The following describe-instances example displays details about all instances with the specified type that are also in the specified Avail- ability Zone. aws ec2 describe-instances \ --filters Name=instance-type,Values=t2.micro,t3.micro Name=availability-zone,Values=us-east-2c The following describe-instances example uses a JSON input file to per- form the same filtering as the previous example. When filters get more complicated, they can be easier to specify in a JSON file. aws ec2 describe-instances --filters file://filters.json Contents of filters.json: [ { "Name": "instance-type", "Values": ["t2.micro", "t3.micro"] }, { "Name": "availability-zone", "Values": ["us-east-2c"] } ] Example 5: To restrict the results to only specified fields The following describe-instances example uses the --query parameter to display only the AMI ID and tags for the specified instance. aws ec2 describe-instances \ --instance-id i-1234567890abcdef0 \ --query "Reservations[*].Instances[*].[ImageId,Tags[*]]" The following describe-instances example uses the --query parameter to display only the instance and subnet IDs for all instances. Linux Command: aws ec2 describe-instances \ --query 'Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}' \ --output json Windows Command: aws ec2 describe-instances ^ --query "Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}" ^ --output json Output: [ { "Instance": "i-057750d42936e468a", "Subnet": "subnet-069beee9b12030077" }, { "Instance": "i-001efd250faaa6ffa", "Subnet": "subnet-0b715c6b7db68927a" }, { "Instance": "i-027552a73f021f3bd", "Subnet": "subnet-0250c25a1f4e15235" } ] Example 6: To describe instances with a specific tag and filter the results to specific fields The following describe-instances example displays the instance ID, Availability Zone, and the value of the Name tag for instances that have a tag with the name tag-key. Linux Command: aws ec2 describe-instances \ --filter Name=tag-key,Values=Name \ --query 'Reservations[*].Instances[*].{Instance:InstanceId,AZ:Placement.AvailabilityZone,Name:Tags[?Key==`Name`]|[0].Value}' \ --output table Windows Command: aws ec2 describe-instances ^ --filter Name=tag-key,Values=Name ^ --query "Reservations[*].Instances[*].{Instance:InstanceId,AZ:Placement.AvailabilityZone,Name:Tags[?Key=='Name']|[0].Value}" ^ --output table Output: ------------------------------------------------------------- | DescribeInstances | +--------------+-----------------------+--------------------+ | AZ | Instance | Name | +--------------+-----------------------+--------------------+ | us-east-2b | i-057750d42936e468a | my-prod-server | | us-east-2a | i-001efd250faaa6ffa | test-server-1 | | us-east-2a | i-027552a73f021f3bd | test-server-2 | +--------------+-----------------------+--------------------+ Example 7: To view the partition number for an instance in a partition placement group The following describe-instances example displays details about the specified instance. The output includes the placement information for the instance, which contains the placement group name and the partition number for the instance. aws ec2 describe-instances \ --instance-id i-0123a456700123456 The following output is truncated to show only the relevant informa- tion: "Placement": { "AvailabilityZone": "us-east-1c", "GroupName": "HDFS-Group-A", "PartitionNumber": 3, "Tenancy": "default" } For more information, see Describing Instances in a Placement Group in the Amazon Elastic Compute Cloud Users Guide. Example 8: To filter instances for a specific partition placement group and partition number The following describe-instances example filters the results to only those instances with the specified placement group and partition num- ber. aws ec2 describe-instances \ --filters "Name = placement-group-name, Values = HDFS-Group-A" "Name = placement-partition-number, Values = 7" The following output is truncated to show only the relevant pieces: "Instances": [ { "InstanceId": "i-0123a456700123456", "InstanceType": "r4.large", "Placement": { "AvailabilityZone": "us-east-1c", "GroupName": "HDFS-Group-A", "PartitionNumber": 7, "Tenancy": "default" } }, { "InstanceId": "i-9876a543210987654", "InstanceType": "r4.large", "Placement": { "AvailabilityZone": "us-east-1c", "GroupName": "HDFS-Group-A", "PartitionNumber": 7, "Tenancy": "default" } ], For more information, see Describing Instances in a Placement Group in the Amazon Elastic Compute Cloud Users Guide.OUTPUT Reservations -> (list) Information about the reservations. (structure) Describes a reservation. Groups -> (list) [EC2-Classic only] The security groups. (structure) Describes a security group. GroupName -> (string) The name of the security group. GroupId -> (string) The ID of the security group. Instances -> (list) The instances. (structure) Describes an instance. AmiLaunchIndex -> (integer) The AMI launch index, which can be used to find this instance in the launch group. ImageId -> (string) The ID of the AMI used to launch the instance. InstanceId -> (string) The ID of the instance. InstanceType -> (string) The instance type. KernelId -> (string) The kernel associated with this instance, if applica- ble. KeyName -> (string) The name of the key pair, if this instance was launched with an associated key pair. LaunchTime -> (timestamp) The time the instance was launched. Monitoring -> (structure) The monitoring for the instance. State -> (string) Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled. Placement -> (structure) The location where the instance launched, if applica- ble. AvailabilityZone -> (string) The Availability Zone of the instance. If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region. This parameter is not supported by CreateFleet . Affinity -> (string) The affinity setting for the instance on the Dedi- cated Host. This parameter is not supported for the ImportInstance command. This parameter is not supported by CreateFleet . GroupName -> (string) The name of the placement group the instance is in. PartitionNumber -> (integer) The number of the partition the instance is in. Valid only if the placement group strategy is set to partition . This parameter is not supported by CreateFleet . HostId -> (string) The ID of the Dedicated Host on which the instance resides. This parameter is not supported for the ImportInstance command. This parameter is not supported by CreateFleet . Tenancy -> (string) The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the ImportInstance command. This parameter is not supported by CreateFleet . SpreadDomain -> (string) Reserved for future use. This parameter is not supported by CreateFleet . HostResourceGroupArn -> (string) The ARN of the host resource group in which to launch the instances. If you specify a host resource group ARN, omit the Tenancy parameter or set it to host . This parameter is not supported by CreateFleet . Platform -> (string) The value is Windows for Windows instances; otherwise blank. PrivateDnsName -> (string) (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not avail- able until the instance enters the running state. [EC2-VPC] The Amazon-provided DNS server resolves Ama- zon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate. PrivateIpAddress -> (string) The private IPv4 address assigned to the instance. ProductCodes -> (list) The product codes attached to this instance, if appli- cable. (structure) Describes a product code. ProductCodeId -> (string) The product code. ProductCodeType -> (string) The type of product code. PublicDnsName -> (string) (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters the running state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your VPC. PublicIpAddress -> (string) The public IPv4 address assigned to the instance, if applicable. RamdiskId -> (string) The RAM disk associated with this instance, if appli- cable. State -> (structure) The current state of the instance. Code -> (integer) The state of the instance as a 16-bit unsigned integer. The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored. The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255. The valid values for instance-state-code will all be in the range of the low byte and they are: o 0 : pending o 16 : running o 32 : shutting-down o 48 : terminated o 64 : stopping o 80 : stopped You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal. Name -> (string) The current state of the instance. StateTransitionReason -> (string) The reason for the most recent state transition. This might be an empty string. SubnetId -> (string) [EC2-VPC] The ID of the subnet in which the instance is running. VpcId -> (string) [EC2-VPC] The ID of the VPC in which the instance is running. Architecture -> (string) The architecture of the image. BlockDeviceMappings -> (list) Any block device mapping entries for the instance. (structure) Describes a block device mapping. DeviceName -> (string) The device name (for example, /dev/sdh or xvdh ). Ebs -> (structure) Parameters used to automatically set up EBS volumes when the instance is launched. AttachTime -> (timestamp) The time stamp when the attachment initi- ated. DeleteOnTermination -> (boolean) Indicates whether the volume is deleted on instance termination. Status -> (string) The attachment state. VolumeId -> (string) The ID of the EBS volume. ClientToken -> (string) The idempotency token you provided when you launched the instance, if applicable. EbsOptimized -> (boolean) Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated through- put to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance. EnaSupport -> (boolean) Specifies whether enhanced networking with ENA is enabled. Hypervisor -> (string) The hypervisor type of the instance. The value xen is used for both Xen and Nitro hypervisors. IamInstanceProfile -> (structure) The IAM instance profile associated with the instance, if applicable. Arn -> (string) The Amazon Resource Name (ARN) of the instance profile. Id -> (string) The ID of the instance profile. InstanceLifecycle -> (string) Indicates whether this is a Spot Instance or a Sched- uled Instance. ElasticGpuAssociations -> (list) The Elastic GPU associated with the instance. (structure) Describes the association between an instance and an Elastic Graphics accelerator. ElasticGpuId -> (string) The ID of the Elastic Graphics accelerator. ElasticGpuAssociationId -> (string) The ID of the association. ElasticGpuAssociationState -> (string) The state of the association between the instance and the Elastic Graphics accelerator. ElasticGpuAssociationTime -> (string) The time the Elastic Graphics accelerator was associated with the instance. ElasticInferenceAcceleratorAssociations -> (list) The elastic inference accelerator associated with the instance. (structure) Describes the association between an instance and an elastic inference accelerator. ElasticInferenceAcceleratorArn -> (string) The Amazon Resource Name (ARN) of the elastic inference accelerator. ElasticInferenceAcceleratorAssociationId -> (string) The ID of the association. ElasticInferenceAcceleratorAssociationState -> (string) The state of the elastic inference accelerator. ElasticInferenceAcceleratorAssociationTime -> (timestamp) The time at which the elastic inference accel- erator is associated with an instance. NetworkInterfaces -> (list) [EC2-VPC] The network interfaces for the instance. (structure) Describes a network interface. Association -> (structure) The association information for an Elastic IPv4 associated with the network interface. IpOwnerId -> (string) The ID of the owner of the Elastic IP address. PublicDnsName -> (string) The public DNS name. PublicIp -> (string) The public IP address or Elastic IP address bound to the network interface. Attachment -> (structure) The network interface attachment. AttachTime -> (timestamp) The time stamp when the attachment initi- ated. AttachmentId -> (string) The ID of the network interface attachment. DeleteOnTermination -> (boolean) Indicates whether the network interface is deleted when the instance is terminated. DeviceIndex -> (integer) The index of the device on the instance for the network interface attachment. Status -> (string) The attachment state. Description -> (string) The description. Groups -> (list) One or more security groups. (structure) Describes a security group. GroupName -> (string) The name of the security group. GroupId -> (string) The ID of the security group. Ipv6Addresses -> (list) One or more IPv6 addresses associated with the network interface. (structure) Describes an IPv6 address. Ipv6Address -> (string) The IPv6 address. MacAddress -> (string) The MAC address. NetworkInterfaceId -> (string) The ID of the network interface. OwnerId -> (string) The ID of the AWS account that created the net- work interface. PrivateDnsName -> (string) The private DNS name. PrivateIpAddress -> (string) The IPv4 address of the network interface within the subnet. PrivateIpAddresses -> (list) One or more private IPv4 addresses associated with the network interface. (structure) Describes a private IPv4 address. Association -> (structure) The association information for an Elas- tic IP address for the network inter- face. IpOwnerId -> (string) The ID of the owner of the Elastic IP address. PublicDnsName -> (string) The public DNS name. PublicIp -> (string) The public IP address or Elastic IP address bound to the network inter- face. Primary -> (boolean) Indicates whether this IPv4 address is the primary private IP address of the network interface. PrivateDnsName -> (string) The private IPv4 DNS name. PrivateIpAddress -> (string) The private IPv4 address of the network interface. SourceDestCheck -> (boolean) Indicates whether to validate network traffic to or from this network interface. Status -> (string) The status of the network interface. SubnetId -> (string) The ID of the subnet. VpcId -> (string) The ID of the VPC. InterfaceType -> (string) Describes the type of network interface. Valid values: interface | efa OutpostArn -> (string) The Amazon Resource Name (ARN) of the Outpost. RootDeviceName -> (string) The device name of the root device volume (for exam- ple, /dev/sda1 ). RootDeviceType -> (string) The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume. SecurityGroups -> (list) The security groups for the instance. (structure) Describes a security group. GroupName -> (string) The name of the security group. GroupId -> (string) The ID of the security group. SourceDestCheck -> (boolean) Specifies whether to enable an instance launched in a VPC to perform NAT. This controls whether source/des- tination checking is enabled on the instance. A value of true means that checking is enabled, and false means that checking is disabled. The value must be false for the instance to perform NAT. For more infor- mation, see NAT Instances in the Amazon Virtual Pri- vate Cloud User Guide . SpotInstanceRequestId -> (string) If the request is a Spot Instance request, the ID of the request. SriovNetSupport -> (string) Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled. StateReason -> (structure) The reason for the most recent state transition. Code -> (string) The reason code for the state change. Message -> (string) The message for the state change. o Server.InsufficientInstanceCapacity : There was insufficient capacity available to satisfy the launch request. o Server.InternalError : An internal error caused the instance to terminate during launch. o Server.ScheduledStop : The instance was stopped due to a scheduled retirement. o Server.SpotInstanceShutdown : The instance was stopped because the number of Spot requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an increase in the Spot price. o Server.SpotInstanceTermination : The instance was terminated because the number of Spot requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an increase in the Spot price. o Client.InstanceInitiatedShutdown : The instance was shut down using the shutdown -h command from the instance. o Client.InstanceTerminated : The instance was terminated or rebooted during AMI creation. o Client.InternalError : A client error caused the instance to terminate during launch. o Client.InvalidSnapshot.NotFound : The specified snapshot was not found. o Client.UserInitiatedHibernate : Hibernation was initiated on the instance. o Client.UserInitiatedShutdown : The instance was shut down using the Amazon EC2 API. o Client.VolumeLimitExceeded : The limit on the number of EBS volumes or total storage was exceeded. Decrease usage or request an increase in your account limits. Tags -> (list) Any tags assigned to the instance. (structure) Describes a tag. Key -> (string) The key of the tag. Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: . Value -> (string) The value of the tag. Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters. VirtualizationType -> (string) The virtualization type of the instance. CpuOptions -> (structure) The CPU options for the instance. CoreCount -> (integer) The number of CPU cores for the instance. ThreadsPerCore -> (integer) The number of threads per CPU core. CapacityReservationId -> (string) The ID of the Capacity Reservation. CapacityReservationSpecification -> (structure) Information about the Capacity Reservation targeting option. CapacityReservationPreference -> (string) Describes the instance's Capacity Reservation preferences. Possible preferences include: o open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone). o none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity. CapacityReservationTarget -> (structure) Information about the targeted Capacity Reserva- tion. CapacityReservationId -> (string) The ID of the Capacity Reservation. HibernationOptions -> (structure) Indicates whether the instance is enabled for hiberna- tion. Configured -> (boolean) If this parameter is set to true , your instance is enabled for hibernation; otherwise, it is not enabled for hibernation. Licenses -> (list) The license configurations. (structure) Describes a license configuration. LicenseConfigurationArn -> (string) The Amazon Resource Name (ARN) of the license configuration. MetadataOptions -> (structure) The metadata options for the instance. State -> (string) The state of the metadata option changes. pending - The metadata options are being updated and the instance is not ready to process metadata traffic with the new selec- tion. applied - The metadata options have been suc- cessfully applied on the instance. HttpTokens -> (string) The state of token usage for your instance meta- data requests. If the parameter is not specified in the request, the default state is optional . If the state is optional , you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role creden- tials are returned. If the state is required , you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credential always returns the version 2.0 creden- tials; the version 1.0 credentials are not avail- able. HttpPutResponseHopLimit -> (integer) The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. Default: 1 Possible values: Integers from 1 to 64 HttpEndpoint -> (string) This parameter enables or disables the HTTP meta- data endpoint on your instances. If the parameter is not specified, the default state is enabled . NOTE: If you specify a value of disabled , you will not be able to access your instance metadata. OwnerId -> (string) The ID of the AWS account that owns the reservation. RequesterId -> (string) The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling). ReservationId -> (string) The ID of the reservation. NextToken -> (string) The token to use to retrieve the next page of results. This value is null when there are no more results to return. DESCRIBE-INSTANCES()
他的回复:
[ec2-user@ip-10-219-14-8 ~]$ aws ec2 -usage: aws [options] [ ...] [parameters]To see help text, you can run: aws help aws help aws helpaws: error: argument operation: Invalid choice, valid choices are:accept-reserved-instances-exchange-quote | accept-transit-gateway-peering-attachmentaccept-transit-gateway-vpc-attachment | accept-vpc-endpoint-connections accept-vpc-peering-connection | advertise-byoip-cidr allocate-address | allocate-hosts apply-security-groups-to-client-vpn-target-network | assign-ipv6-addresses assign-private-ip-addresses | associate-address associate-client-vpn-target-network | associate-dhcp-options associate-iam-instance-profile | associate-route-table associate-subnet-cidr-block | associate-transit-gateway-multicast-domainassociate-transit-gateway-route-table | associate-vpc-cidr-block attach-classic-link-vpc | attach-internet-gateway attach-network-interface | attach-volume attach-vpn-gateway | authorize-client-vpn-ingress authorize-security-group-egress | authorize-security-group-ingress bundle-instance | cancel-bundle-task cancel-capacity-reservation | cancel-conversion-task cancel-export-task | cancel-import-task cancel-reserved-instances-listing | cancel-spot-fleet-requests cancel-spot-instance-requests | confirm-product-instance copy-fpga-image | copy-image copy-snapshot | create-capacity-reservation create-client-vpn-endpoint | create-client-vpn-route create-customer-gateway | create-default-subnet create-default-vpc | create-dhcp-options create-egress-only-internet-gateway | create-fleet create-flow-logs | create-fpga-image create-image | create-instance-export-task create-internet-gateway | create-key-pair create-launch-template | create-launch-template-version create-local-gateway-route | create-local-gateway-route-table-vpc-associationcreate-nat-gateway | create-network-acl create-network-acl-entry | create-network-interface create-network-interface-permission | create-placement-group create-reserved-instances-listing | create-route create-route-table | create-security-group create-snapshot | create-snapshots create-spot-datafeed-subscription | create-subnet create-tags | create-traffic-mirror-filter create-traffic-mirror-filter-rule | create-traffic-mirror-session create-traffic-mirror-target | create-transit-gateway create-transit-gateway-multicast-domain | create-transit-gateway-peering-attachmentcreate-transit-gateway-route | create-transit-gateway-route-table create-transit-gateway-vpc-attachment | create-volume create-vpc | create-vpc-endpoint create-vpc-endpoint-connection-notification | create-vpc-endpoint-service-configurationcreate-vpc-peering-connection | create-vpn-connection create-vpn-connection-route | create-vpn-gateway delete-client-vpn-endpoint | delete-client-vpn-route delete-customer-gateway | delete-dhcp-options delete-egress-only-internet-gateway | delete-fleets delete-flow-logs | delete-fpga-image delete-internet-gateway | delete-key-pair delete-launch-template | delete-launch-template-versions delete-local-gateway-route | delete-local-gateway-route-table-vpc-associationdelete-nat-gateway | delete-network-acl delete-network-acl-entry | delete-network-interface delete-network-interface-permission | delete-placement-group delete-queued-reserved-instances | delete-route delete-route-table | delete-security-group delete-snapshot | delete-spot-datafeed-subscription delete-subnet | delete-tags delete-traffic-mirror-filter | delete-traffic-mirror-filter-rule delete-traffic-mirror-session | delete-traffic-mirror-target delete-transit-gateway | delete-transit-gateway-multicast-domain delete-transit-gateway-peering-attachment | delete-transit-gateway-route delete-transit-gateway-route-table | delete-transit-gateway-vpc-attachment delete-volume | delete-vpc delete-vpc-endpoint-connection-notifications | delete-vpc-endpoint-service-configurationsdelete-vpc-endpoints | delete-vpc-peering-connection delete-vpn-connection | delete-vpn-connection-route delete-vpn-gateway | deprovision-byoip-cidr deregister-image | deregister-instance-event-notification-attributesderegister-transit-gateway-multicast-group-members | deregister-transit-gateway-multicast-group-sourcesdescribe-account-attributes | describe-addresses describe-aggregate-id-format | describe-availability-zones describe-bundle-tasks | describe-byoip-cidrs describe-capacity-reservations | describe-classic-link-instances describe-client-vpn-authorization-rules | describe-client-vpn-connections describe-client-vpn-endpoints | describe-client-vpn-routes describe-client-vpn-target-networks | describe-coip-pools describe-conversion-tasks | describe-customer-gateways describe-dhcp-options | describe-egress-only-internet-gateways describe-elastic-gpus | describe-export-image-tasks describe-export-tasks | describe-fast-snapshot-restores describe-fleet-history | describe-fleet-instances describe-fleets | describe-flow-logs describe-fpga-image-attribute | describe-fpga-images describe-host-reservation-offerings | describe-host-reservations describe-hosts | describe-iam-instance-profile-associationsdescribe-id-format | describe-identity-id-format describe-image-attribute | describe-images describe-import-image-tasks | describe-import-snapshot-tasks describe-instance-attribute | describe-instance-credit-specifications describe-instance-event-notification-attributes | describe-instance-status describe-instance-type-offerings | describe-instance-types describe-instances | describe-internet-gateways describe-ipv6-pools | describe-key-pairs describe-launch-template-versions | describe-launch-templates describe-local-gateway-route-table-virtual-interface-group-associations | describe-local-gateway-route-table-vpc-associationsdescribe-local-gateway-route-tables | describe-local-gateway-virtual-interface-groupsdescribe-local-gateway-virtual-interfaces | describe-local-gateways describe-moving-addresses | describe-nat-gateways describe-network-acls | describe-network-interface-attribute describe-network-interface-permissions | describe-network-interfaces describe-placement-groups | describe-prefix-lists describe-principal-id-format | describe-public-ipv4-pools describe-regions | describe-reserved-instances describe-reserved-instances-listings | describe-reserved-instances-modificationsdescribe-reserved-instances-offerings | describe-route-tables describe-scheduled-instance-availability | describe-scheduled-instances describe-security-group-references | describe-security-groups describe-snapshot-attribute | describe-snapshots describe-spot-datafeed-subscription | describe-spot-fleet-instances describe-spot-fleet-request-history | describe-spot-fleet-requests describe-spot-instance-requests | describe-spot-price-history describe-stale-security-groups | describe-subnets describe-tags | describe-traffic-mirror-filters describe-traffic-mirror-sessions | describe-traffic-mirror-targets describe-transit-gateway-attachments | describe-transit-gateway-multicast-domainsdescribe-transit-gateway-peering-attachments | describe-transit-gateway-route-tables describe-transit-gateway-vpc-attachments | describe-transit-gateways describe-volume-attribute | describe-volume-status describe-volumes | describe-volumes-modifications describe-vpc-attribute | describe-vpc-classic-link describe-vpc-classic-link-dns-support | describe-vpc-endpoint-connection-notificationsdescribe-vpc-endpoint-connections | describe-vpc-endpoint-service-configurationsdescribe-vpc-endpoint-service-permissions | describe-vpc-endpoint-services describe-vpc-endpoints | describe-vpc-peering-connections describe-vpcs | describe-vpn-connections describe-vpn-gateways | detach-classic-link-vpc detach-internet-gateway | detach-network-interface detach-volume | detach-vpn-gateway disable-ebs-encryption-by-default | disable-fast-snapshot-restores disable-transit-gateway-route-table-propagation | disable-vgw-route-propagation disable-vpc-classic-link | disable-vpc-classic-link-dns-support disassociate-address | disassociate-client-vpn-target-network disassociate-iam-instance-profile | disassociate-route-table disassociate-subnet-cidr-block | disassociate-transit-gateway-multicast-domaindisassociate-transit-gateway-route-table | disassociate-vpc-cidr-block enable-ebs-encryption-by-default | enable-fast-snapshot-restores enable-transit-gateway-route-table-propagation | enable-vgw-route-propagation enable-volume-io | enable-vpc-classic-link enable-vpc-classic-link-dns-support | export-client-vpn-client-certificate-revocation-listexport-client-vpn-client-configuration | export-image export-transit-gateway-routes | get-associated-ipv6-pool-cidrs get-capacity-reservation-usage | get-coip-pool-usage get-console-output | get-console-screenshot get-default-credit-specification | get-ebs-default-kms-key-id get-ebs-encryption-by-default | get-host-reservation-purchase-preview get-launch-template-data | get-password-data get-reserved-instances-exchange-quote | get-transit-gateway-attachment-propagationsget-transit-gateway-multicast-domain-associations | get-transit-gateway-route-table-associationsget-transit-gateway-route-table-propagations | import-client-vpn-client-certificate-revocation-listimport-image | import-key-pair import-snapshot | modify-availability-zone-group modify-capacity-reservation | modify-client-vpn-endpoint modify-default-credit-specification | modify-ebs-default-kms-key-id modify-fleet | modify-fpga-image-attribute modify-hosts | modify-id-format modify-identity-id-format | modify-image-attribute modify-instance-attribute | modify-instance-capacity-reservation-attributesmodify-instance-credit-specification | modify-instance-event-start-time modify-instance-metadata-options | modify-instance-placement modify-launch-template | modify-network-interface-attribute modify-reserved-instances | modify-snapshot-attribute modify-spot-fleet-request | modify-subnet-attribute modify-traffic-mirror-filter-network-services | modify-traffic-mirror-filter-rule modify-traffic-mirror-session | modify-transit-gateway-vpc-attachment modify-volume | modify-volume-attribute modify-vpc-attribute | modify-vpc-endpoint modify-vpc-endpoint-connection-notification | modify-vpc-endpoint-service-configurationmodify-vpc-endpoint-service-permissions | modify-vpc-peering-connection-options modify-vpc-tenancy | modify-vpn-connection modify-vpn-tunnel-certificate | modify-vpn-tunnel-options monitor-instances | move-address-to-vpc provision-byoip-cidr | purchase-host-reservation purchase-reserved-instances-offering | purchase-scheduled-instances reboot-instances | register-image register-instance-event-notification-attributes | register-transit-gateway-multicast-group-membersregister-transit-gateway-multicast-group-sources | reject-transit-gateway-peering-attachmentreject-transit-gateway-vpc-attachment | reject-vpc-endpoint-connections reject-vpc-peering-connection | release-address release-hosts | replace-iam-instance-profile-associationreplace-network-acl-association | replace-network-acl-entry replace-route | replace-route-table-association replace-transit-gateway-route | report-instance-status request-spot-fleet | request-spot-instances reset-ebs-default-kms-key-id | reset-fpga-image-attribute reset-image-attribute | reset-instance-attribute reset-network-interface-attribute | reset-snapshot-attribute restore-address-to-classic | revoke-client-vpn-ingress revoke-security-group-egress | revoke-security-group-ingress run-instances | run-scheduled-instances search-local-gateway-routes | search-transit-gateway-multicast-groups search-transit-gateway-routes | send-diagnostic-interrupt start-instances | start-vpc-endpoint-service-private-dns-verificationstop-instances | terminate-client-vpn-connections terminate-instances | unassign-ipv6-addresses unassign-private-ip-addresses | unmonitor-instances update-security-group-rule-descriptions-egress | update-security-group-rule-descriptions-ingresswithdraw-byoip-cidr | wait help
他的回复:
麻烦大神发布全系列产品的使用。同时相关操作更方便,更丰富。充分体现华为云强大的CLI功能。下面是AWS。[ec2-user@ip-10-219-14-8 ~]$ aws helpAWS() AWS()NAME aws -DESCRIPTION The AWS Command Line Interface is a unified tool to manage your AWS services.SYNOPSIS aws [options] [parameters] Use aws command help for information on a specific command. Use aws help topics to view a list of available help topics. The synopsis for each command shows its parameters and their usage. Optional parameters are shown in square brackets.OPTIONS --debug (boolean) Turn on debug logging. --endpoint-url (string) Override command's default URL with the given URL. --no-verify-ssl (boolean) By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates. --no-paginate (boolean) Disable automatic pagination. --output (string) The formatting style for command output. o json o text o table --query (string) A JMESPath query to use in filtering the response data. --profile (string) Use a specific profile from your credential file. --region (string) The region to use. Overrides config/env settings. --version (string) Display the version of this tool. --color (string) Turn on/off color output. o on o off o auto --no-sign-request (boolean) Do not sign requests. Credentials will not be loaded if this argument is provided. --ca-bundle (string) The CA certificate bundle to use when verifying SSL certificates. Over- rides config/env settings. --cli-read-timeout (int) The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. --cli-connect-timeout (int) The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout.AVAILABLE SERVICES o accessanalyzer o acm o acm-pca o alexaforbusiness o amplify o apigateway o apigatewaymanagementapi o apigatewayv2 o appconfig o application-autoscaling o application-insights o appmesh o appstream o appsync o athena o autoscaling o autoscaling-plans o backup o batch o budgets o ce o chime o cloud9 o clouddirectory o cloudformation o cloudfront o cloudhsm o cloudhsmv2 o cloudsearch o cloudsearchdomain o cloudtrail o cloudwatch o codebuild o codecommit o codeguru-reviewer o codeguruprofiler o codepipeline o codestar o codestar-connections o codestar-notifications o cognito-identity o cognito-idp o cognito-sync o comprehend o comprehendmedical o compute-optimizer o configservice o configure o connect o connectparticipant o cur o dataexchange o datapipeline o datasync o dax o deploy o detective o devicefarm o directconnect o discovery o dlm o dms o docdb o ds o dynamodb o dynamodbstreams o ebs o ec2 o ec2-instance-connect o ecr o ecs o efs o eks o elastic-inference o elasticache o elasticbeanstalk o elastictranscoder o elb o elbv2 o emr o es o events o firehose o fms o forecast o forecastquery o frauddetector o fsx o gamelift o glacier o globalaccelerator o glue o greengrass o groundstation o guardduty o health o help o history o iam o imagebuilder o importexport o inspector o iot o iot-data o iot-jobs-data o iot1click-devices o iot1click-projects o iotanalytics o iotevents o iotevents-data o iotsecuretunneling o iotsitewise o iotthingsgraph o kafka o kendra o kinesis o kinesis-video-archived-media o kinesis-video-media o kinesis-video-signaling o kinesisanalytics o kinesisanalyticsv2 o kinesisvideo o kms o lakeformation o lambda o lex-models o lex-runtime o license-manager o lightsail o logs o machinelearning o macie o managedblockchain o marketplace-catalog o marketplace-entitlement o marketplacecommerceanalytics o mediaconnect o mediaconvert o medialive o mediapackage o mediapackage-vod o mediastore o mediastore-data o mediatailor o meteringmarketplace o mgh o migrationhub-config o mobile o mq o mturk o neptune o networkmanager o opsworks o opsworks-cm o organizations o outposts o personalize o personalize-events o personalize-runtime o pi o pinpoint o pinpoint-email o pinpoint-sms-voice o polly o pricing o qldb o qldb-session o quicksight o ram o rds o rds-data o redshift o rekognition o resource-groups o resourcegroupstaggingapi o robomaker o route53 o route53domains o route53resolver o s3 o s3api o s3control o sagemaker o sagemaker-a2i-runtime o sagemaker-runtime o savingsplans o schemas o sdb o secretsmanager o securityhub o serverlessrepo o service-quotas o servicecatalog o servicediscovery o ses o sesv2 o shield o signer o sms o snowball o sns o sqs o ssm o sso o sso-oidc o stepfunctions o storagegateway o sts o support o swf o synthetics o textract o transcribe o transfer o translate o waf o waf-regional o wafv2 o workdocs o worklink o workmail o workmailmessageflow o workspaces o xraySEE ALSO o aws help topics AWS()
他的回复:
mkdir ~/.hcloud ; cd ~/.hcloudunzip hcloud-master-dfd1ba51ff0c2ddd73ad7f82762e0951bbee2766.zip; cd hcloud-master-dfd1ba51ff0c2ddd73ad7f82762e0951bbee2766;mv * ../;rm -rf hcloud-master-dfd1ba51ff0c2ddd73ad7f82762e0951bbee2766yum -y install go cd resources/; vim golbal.yaml ;修改Region为cn-north-4;cd ..sh build.sh./hcloud iam login --username="dajia_group" --password="xxxx" { "result": "201 Created", "expires_at": "2020-05-01T00:44:02.261000Z" } 7. ./hcloud ecs list --format=table