Giter Club home page Giter Club logo

egoscale's Introduction

title description
Egoscale
the Go library for Exoscale

Actions Status GoDoc Go Report Card

A wrapper for the Exoscale public cloud API.

Actively maintained version is v2, it can be imported as:

	import "github.com/exoscale/egoscale/v2"

Version v3 is in alpha state and breaking changes are expected.

Known users

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

egoscale's People

Contributors

7felf avatar alexanderjamesking avatar arthuraliiev avatar cab105 avatar chrisglass avatar dependabot[bot] avatar exo-cedric avatar falzm avatar greut avatar illi-j avatar jessicatoscani avatar kobajagi avatar ldez avatar marcaurele avatar mcorbin avatar nbari avatar philippechepy avatar pierre-emmanuelj avatar pyr avatar sauterp avatar sebgoa avatar ste-m avatar stffabi avatar tdantas avatar tgrondier avatar vincentbernat avatar zyegfryed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

egoscale's Issues

"security group not found wrong id or name, got"

something looks broken.

% exo firewall list
┼────────────┼────────────────────────┼──────────────────────────────────────┼
│    NAME    │      DESCRIPTION       │                  ID                  │
┼────────────┼────────────────────────┼──────────────────────────────────────┼
│ my-cluster │                        │ 307d40be-34d1-4d45-8019-ce4a18a74609 │
┼────────────┼────────────────────────┼──────────────────────────────────────┼

%  exo firewall add my-cluster --protocol all --security-group my-cluster 
Security group not found wrong ID or Name, got

% exo firewall add my-cluster --protocol all -c 0.0.0.0/0               
Security group not found wrong ID or Name, got 

Missing commands [RFC]

Please tick the useful commands you'd want to see added.

  • createVPCOffering
  • ldapCreateAccount
  • createPod
  • removeRawUsageRecords
  • copyIso
  • deleteAutoScaleVmProfile
  • addExternalFirewall
  • deleteExternalLoadBalancer
  • listVirtualMachinesMetrics
  • deleteStoragePool
  • listHosts
  • updateStoragePool
  • rebootSystemVm
  • importLdapUsers
  • listDedicatedZones
  • listElastistorPool
  • updateFirewallRule
  • quotaIsEnabled
  • listSrxFirewalls
  • listHypervisors
  • deleteAccountFromProject
  • getSolidFireVolumeAccessGroupId
  • updateGuestOs
  • updateResourceLimit #128
  • deleteStaticRoute
  • listHostsMetrics
  • releaseDedicatedPod
  • deleteRemoteAccessVpn
  • updateNetworkACLList
  • deleteNiciraNvpDevice
  • deleteEvents
  • listUcsBlades
  • notifyBaremetalProvisionDone
  • getVolumeSnapshotDetails
  • deleteIso
  • deleteExternalFirewall
  • updateHost
  • createEgressFirewallRule
  • listVPCOfferings
  • getSolidFireVolumeSize
  • uploadVolume
  • configureOutOfBandManagement
  • listStorageTags
  • listTemplatePermissions
  • destroySystemVm
  • archiveEvents
  • addSwift
  • deleteSecondaryStagingStore
  • addSrxFirewall
  • updateLoadBalancer
  • scaleSystemVm
  • listSnapshotPolicies
  • updateVpnCustomerGateway
  • stopRouter
  • lockAccount
  • listClusters
  • deleteProjectInvitation
  • listProjectInvitations
  • listEgressFirewallRules
  • deleteTrafficType
  • updateRegion
  • listClustersMetrics
  • listLdapConfigurations
  • listSecondaryStagingStores
  • createRemoteAccessVpn
  • startRouter
  • listGuestOsMapping
  • deleteStratosphereSsp
  • createAutoScalePolicy
  • listPhysicalNetworks
  • listFirewallRules
  • deleteBrocadeVcsDevice
  • cleanVMReservations
  • extractIso
  • createSecondaryStagingStore
  • removeVmwareDc
  • listInternalLoadBalancerElements
  • updateLBHealthCheckPolicy
  • createLoadBalancerRule
  • addGuestOsMapping
  • disableOutOfBandManagementForZone
  • configureF5LoadBalancer
  • updateNetworkOffering
  • updateVPC
  • changeOutOfBandManagementPassword
  • deleteEgressFirewallRule
  • stopSystemVm
  • listResourceDetails #99
  • createNetworkOffering
  • dedicateCluster
  • createIpForwardingRule
  • listVolumesMetrics
  • listElastistorInterface
  • listSslCerts
  • listPrivateGateways
  • updateVmNicIp
  • updateLBStickinessPolicy
  • listPods
  • startInternalLoadBalancerVM
  • updateDiskOffering
  • deleteSrxFirewall
  • addAccountToProject
  • resetVpnConnection
  • createAutoScaleVmGroup
  • searchLdap
  • deleteLoadBalancerRule
  • addBaremetalPxePingServer
  • listPortableIpRanges
  • getVirtualMachineUserData #103
  • listConfigurations
  • disableStaticNat
  • deleteUcsManager
  • deleteHost
  • listCapabilities
  • releaseDedicatedZone
  • updateTrafficType
  • listConditions
  • updateNetworkServiceProvider
  • removeFromLoadBalancerRule
  • addNuageVspDevice
  • createStaticRoute
  • addTrafficType
  • deletePrivateGateway
  • listLoadBalancerRuleInstances
  • deleteCondition
  • updateDomain
  • updatePhysicalNetwork
  • disableAutoScaleVmGroup
  • createSnapshotPolicy
  • deleteNuageVspDevice
  • createRolePermission
  • listSystemVms
  • createProject
  • assignCertToLoadBalancer
  • addCiscoVnmcResource
  • replaceNetworkACLList
  • detachVolume
  • markDefaultZoneForAccount
  • enableOutOfBandManagementForZone
  • listLdapUsers
  • changeServiceForSystemVm
  • listIpForwardingRules
  • deleteVMSnapshot
  • listStoragePoolsMetrics
  • rebootRouter
  • listStoragePools
  • findHostsForMigration
  • updateHypervisorCapabilities
  • enableCiscoNexusVSM
  • dedicateGuestVlanRange
  • listStaticRoutes
  • listF5LoadBalancers
  • listExternalLoadBalancers
  • updateIso
  • listOpenDaylightControllers
  • addBigSwitchBcfDevice
  • deleteCounter
  • issueOutOfBandManagementPowerAction
  • deleteUser
  • deleteNetworkDevice
  • createPortForwardingRule
  • dedicateZone
  • prepareTemplate #125
  • assignToLoadBalancerRule
  • tmProvisionVirtualMachine
  • archiveAlerts
  • deleteCiscoVnmcResource
  • stopInternalLoadBalancerVM
  • addBrocadeVcsDevice
  • createDomain
  • listExternalFirewalls
  • login
  • listHypervisorCapabilities
  • addImageStore
  • tmDestroyVirtualMachine
  • getSolidFireAccountId
  • listSupportedNetworkServices
  • listRolePermissions
  • listDedicatedGuestVlanRanges
  • listNetworkACLs
  • addNetworkServiceProvider
  • deleteVpnGateway
  • copyTemplate #125
  • createServiceOffering
  • listNiciraNvpDeviceNetworks
  • assignVirtualMachine
  • deleteBigSwitchBcfDevice
  • configureNetscalerLoadBalancer
  • listOvsElements
  • associateUcsProfileToBlade
  • deleteNetworkServiceProvider
  • deleteNetworkOffering
  • dedicatePod
  • listNetworkDevice
  • updateStorageNetworkIpRange
  • deleteOpenDaylightController
  • updateTemplate #125
  • createVlanIpRange
  • updateVpnConnection
  • listPaloAltoFirewallNetworks
  • getPathForVolume
  • listUcsManagers
  • changeServiceForRouter
  • deleteLdapConfiguration
  • updateVolume
  • listTrafficTypes
  • addSecondaryStorage
  • updateAccount
  • disableAccount #102
  • listDomains
  • listUsageTypes
  • listNetworkACLLists
  • deleteTemplate #125
  • deleteVPC
  • updateVpnGateway
  • releaseDedicatedGuestVlanRange
  • migrateVirtualMachine #126
  • createTemplate #125
  • listBaremetalRct
  • listDedicatedClusters
  • uploadCustomCertificate
  • deleteVpnCustomerGateway
  • enableOutOfBandManagementForCluster
  • listPortForwardingRules
  • updateTemplatePermissions
  • listTrafficMonitors
  • updatePortForwardingRule
  • listBrocadeVcsDevices
  • linkDomainToLdap
  • deleteVpnConnection
  • deleteF5LoadBalancer
  • createNetworkACL
  • listVpnCustomerGateways
  • createGlobalLoadBalancerRule
  • deleteNetscalerLoadBalancer
  • listGlobalLoadBalancerRules
  • deleteDiskOffering
  • releaseDedicatedCluster
  • createVirtualRouterElement
  • createVPC
  • deleteAutoScalePolicy
  • deleteRole
  • deleteCiscoNexusVSM
  • listInternalLoadBalancerVMs
  • listCiscoVnmcResources
  • removeResourceDetail
  • listOsTypes
  • removeGuestOs
  • listSrxFirewallNetworks
  • detachIso
  • deletePaloAltoFirewall
  • deletePod
  • listDeploymentPlanners
  • deleteCluster
  • prepareHostForMaintenance
  • createRole
  • removeRegion
  • getVolumeiScsiName
  • getUploadParamsForVolume
  • updateAutoScaleVmProfile
  • updateAutoScaleVmGroup
  • enableAutoScaleVmGroup
  • updateGuestOsMapping
  • listDiskOfferings
  • updateHostPassword
  • createPortableIpRange
  • deleteCiscoAsa1000vResource
  • updateCluster
  • listUcsProfiles
  • listStorageProviders
  • updateGlobalLoadBalancerRule
  • createCondition
  • listProjects
  • createAccount
  • revertToVMSnapshot
  • addGuestOs
  • listHostTags
  • removeGuestOsMapping
  • registerIso
  • listCiscoAsa1000vResources
  • listElastistorVolume
  • deletePortableIpRange
  • listNiciraNvpDevices
  • addBaremetalPxeKickStartServer
  • listAlerts
  • upgradeRouterTemplate
  • extractVolume
  • listVlanIpRanges
  • listNuageVspDevices
  • cancelHostMaintenance
  • updateZone
  • listProjectAccounts
  • addExternalLoadBalancer
  • updateAutoScalePolicy
  • createDiskOffering
  • createLBHealthCheckPolicy
  • lockUser
  • listLBHealthCheckPolicies
  • listDedicatedPods
  • listVPCs
  • migrateVirtualMachineWithVolume
  • addNetworkDevice
  • updateUser #99
  • restartVPC
  • removeCertFromLoadBalancer
  • addHost
  • attachVolume
  • addBaremetalDhcp
  • addTrafficMonitor
  • listLoadBalancers
  • updateProject
  • deleteLBStickinessPolicy
  • listUsers #99
  • listVpnConnections
  • disableUser
  • listIsos
  • updateCloudToUseObjectStore
  • listAutoScalePolicies
  • addBaremetalRct
  • updateRole
  • listVmwareDcs
  • listRemoteAccessVpns
  • deleteNetworkACLList
  • createServiceInstance
  • releasePublicIpRange
  • listNetscalerLoadBalancerNetworks
  • startSystemVm
  • listNetworkIsolationMethods
  • listStorageNetworkIpRange
  • deleteDomain
  • configureVirtualRouterElement
  • migrateVolume
  • configureSrxFirewall
  • resetApiLimit
  • createInternalLoadBalancerElement
  • deleteVlanIpRange
  • generateAlert
  • addLdapConfiguration
  • ldapConfig
  • deletePortForwardingRule
  • deleteGlobalLoadBalancerRule
  • listBigSwitchBcfDevices
  • updateConfiguration
  • dedicatePublicIpRange
  • enableStaticNat
  • deleteZone
  • getUploadParamsForTemplate
  • releaseDedicatedHost
  • updateProjectInvitation
  • listRegions
  • configureInternalLoadBalancerElement
  • migrateSystemVm
  • listCounters
  • listVirtualRouterElements
  • deleteSnapshotPolicies
  • listTrafficTypeImplementors
  • deleteImageStore
  • listAutoScaleVmProfiles
  • disableOutOfBandManagementForHost
  • updateResourceCount
  • listVpnGateways
  • listRoles
  • getCloudIdentifier
  • createLBStickinessPolicy
  • configurePaloAltoFirewall
  • addCiscoAsa1000vResource
  • updateNetworkACLItem
  • listRouters
  • releaseHostReservation
  • createVpnConnection
  • listBrocadeVcsDeviceNetworks
  • deletePhysicalNetwork
  • dedicateHost
  • removeVpnUser
  • addGloboDnsHost
  • logout
  • deleteLBHealthCheckPolicy
  • listSwifts
  • enableOutOfBandManagementForHost
  • deleteServiceOffering
  • addNiciraNvpDevice
  • addF5LoadBalancer
  • listNetworkServiceProviders
  • listInfrastructure
  • listUsageRecords
  • deleteVolume
  • enableUser
  • listZonesMetrics
  • extractTemplate #125 ?
  • suspendProject
  • getApiLimit #128
  • deleteStorageNetworkIpRange
  • addVmwareDc
  • updateIsoPermissions
  • registerTemplate #125
  • deleteVPCOffering
  • addStratosphereSsp
  • updateNuageVspDevice
  • deleteNetworkACL
  • createStoragePool
  • findStoragePoolsForMigration
  • addOpenDaylightController
  • createZone
  • disableCiscoNexusVSM
  • createStorageNetworkIpRange
  • listDomainChildren
  • assignToGlobalLoadBalancerRule
  • configureOvsElement
  • addImageStoreS3
  • createPhysicalNetwork
  • listAutoScaleVmGroups
  • createFirewallRule
  • createVolume
  • listF5LoadBalancerNetworks
  • listVMSnapshot
  • updatePod
  • attachIso
  • listBaremetalDhcp
  • tmMigrateVirtualMachine
  • enableStorageMaintenance
  • ldapRemove
  • createUser #99
  • deleteBaremetalRct
  • createVpnGateway
  • addResourceDetail
  • createVMSnapshot
  • listVpnUsers
  • deleteLoadBalancer
  • deleteIpForwardingRule
  • addRegion
  • generateUsageRecords
  • updateRolePermission
  • cancelStorageMaintenance
  • destroyRouter
  • updateSnapshotPolicy
  • listImageStores
  • deleteAccount
  • createCounter
  • disableOutOfBandManagementForCluster
  • addCluster
  • deleteTrafficMonitor
  • activateProject
  • deleteSslCert
  • listDedicatedHosts
  • deleteAutoScaleVmGroup
  • listPaloAltoFirewalls
  • updateLoadBalancerRule
  • deleteAlerts
  • enableAccount #102
  • createAutoScaleVmProfile
  • listLBStickinessPolicies
  • addUcsManager
  • reconnectHost
  • deleteProject
  • listNetscalerLoadBalancers
  • addNetscalerLoadBalancer
  • listIsoPermissions
  • createLoadBalancer
  • listBaremetalPxeServers
  • addPaloAltoFirewall
  • createPrivateGateway
  • listLoadBalancerRules
  • getUser
  • deleteFirewallRule
  • uploadSslCert
  • createVpnCustomerGateway
  • listCiscoNexusVSMs
  • addVpnUser
  • addBaremetalHost
  • deleteRolePermission
  • updateRemoteAccessVpn
  • updateVPCOffering
  • updateEgressFirewallRule
  • listOsCategories
  • removeFromGlobalLoadBalancerRule
  • listCapacity
  • updateServiceOffering
  • createNetworkACLList

generic Create

err := client.Create(&egoscale.SecurityGroup{
    Name:        "Hello",
    Description: "This is a test",
})

list firewall vs show firewall

% exo firewall

list List security groups or show a security group rules details

that or means it should have two commands, list and show

exo config format

in the issue #179 we want to leave from cloudstack.iniconfiguration file. So what can be the new format of our new config file

Advantage:

  • usable with spf13/viper
  • manage accounts more easily
  • create an environment for each account

exo firewall add X http https only creates http

$ exo firewall add rancher http https
TYPE SOURCE PROTOCOL PORT DESCRIPTION ID
INGRESS CIDR 0.0.0.0/0 tcp 80 (http) 7372b893-42ca-465e-8596-ff8de5dad088

is it easy to support multiple rules ?

exo k8s - rke check should be done before the deployment

Deploying node-1..
Creating sshkey
Deploying node-2...
Creating sshkey
Deploying node-3...
Installing Docker on node(s).................................................
RKE install:
2018/06/29 09:09:06 exec: "rke": executable file not found in $PATH

Replace IterateItemFunc to use pointers [rfc]

When use Paginate, the callback function receives the value itself rather than a pointer to it. It's premature optimization but it would be more efficient and similar the the other calls to have a pointer instead.

// direct call - no pagination
r, _ := client.Request(&egoscale.ListAPIs{})
apis := r.(*egoscale.ListAPIsResponse).API

// whole list with Pagination
apis, _ := client.List(&egoscale.API{})
for _, i := range apis {
    // now
    api := i.(egoscale.API)
    // proposal
    api := i.(*egoscale.API)

    // ...
}

// iterate with pagination
client.Paginate(&egoscale.ListAPIs, func(i interface{}, e error) bool {
    // now
    api := i.(egoscale.API)
    // proposal
    api := i.(*egoscale.API)

    // ...
})

exo config show to display current config

at the moment, exo config show wants an explicit configuration to be displayed. It'd be nice to have the default one.

% exo config show
(help)

% exo config list
- foo [default]

% exo config show foo
what I wanted in the first play

All calls should accept a context

Current API

  • client.Request(command)
  • client.AsyncRequest(command, {Delay, Retries})

Additional API

  • client.RequestWithContext(ctx, command)
  • client.AsyncRequestWithContext(ctx, command), you are responsible to give a ctx with a Timeout or Cancel it.

The async request, can have a default strategy to retry on the server in a decent fashion. E.g. at x% of the remaining time (where x changes).

https://github.com/xanzy/go-cloudstack/blob/master/cloudstack/cloudstack.go#L286-L290

Issues

A call may take some time, and one cannot cancel it. It should accept a context everywhere.

At Google, we require that Go programmers pass a Context parameter as the first argument to every function on the call path between incoming and outgoing requests. This allows Go code developed by many different teams to interoperate well. It provides simple control over timeouts and cancelation and ensures that critical values like security credentials transit Go programs properly.

https://blog.golang.org/context

cf. #41

exo template list <??>

two little things with template list

template := &egoscale.Template{IsFeatured: true, ZoneID: "1"}

  1. it promotes bad usage of the API with the ZoneID = 1, when it should use the defaultZone instead
  2. it could take another set of arguments given to keyword
$ exo template list LTS
"Linux Ubuntu 18.04 LTS 64-bit 10G Disk (2018-04-26-0e6133)"
"Linux Ubuntu 16.04 LTS 64-bit 10G Disk (2018-03-02-5858e9)"

exo vm create panics

$ ./exo vm create hello        
panic: unable to redefine 'a' shorthand in "create" flagset: it's already used for "anti-affinity-group" flag

Using 7dd1d92

filtering templates of same kind

% exo vm create huey --cloud-init-file init.yml --service-offering medium --template "Ubuntu 16.04 LTS" --security-group my-cluster
more than one template found for "Ubuntu 16.04 LTS" 

The issue is linked wit the fact that this particular template still has the various sizes around.

% cs listTemplates --templatefilter=featured --keyword="16.04" --zoneid=1 | jq ".template[].displaytext"
"Linux Ubuntu 16.04 LTS 64-bit 10G Disk (2018-03-02-5858e9)"
"Linux Ubuntu 16.04 LTS 64-bit 400G Disk (2018-01-23-8856b8)"
"Linux Ubuntu 16.04 LTS 64-bit 50G Disk (2018-01-23-8856b8)"
"Linux Ubuntu 16.04 LTS 64-bit 200G Disk (2018-01-23-8856b8)"
"Linux Ubuntu 16.04 LTS 64-bit 100G Disk (2018-01-23-8856b8)"

fixing it is a hack... but it's already being made for template list

cli to use context

Anything can fail, take way longer than expected, etc...

Scenario, the VM doesn't have the port 22 open.

$ exo firewall remove default0 <...>   # port 22
$ exo ssh my-vm
Warning: Identity file /home/yoan/.exoscale/instances/bed92ae5-494e-4802-80ab-e28dc633e1a8/id_rsa not accessible: No such file or directory.
<hanging there for a very long time>
ssh: connect to host 159.100.251.224 port 22: Connection timed out
2018/06/21 10:00:38 exit status 255

Example:
kubernetes/kubectl@7448de5

The ability to continue the flow after a ^C could become useful.

Missing doc

(via generate/main)

  • ExpungeVirtualMachine 1
  • ListSnapshots 1
  • ListEvents 13
  • ListAffinityGroups 9
  • ListNics 5
  • ScaleVirtualMachine 3
  • AssociateIPAddress 9
  • UpdateVMAffinityGroup 3
  • StopVirtualMachine 2
  • UpdateInstanceGroup 2
  • DeployVirtualMachine 32
  • ListAffinityGroupTypes 1
  • GetVMPassword 1
  • ListTemplates 13
  • ActivateIP6 1
  • ListZones 1
  • UpdateUser 2
  • CreateInstanceGroup 4
  • ListAccounts 9
  • DestroyVirtualMachine 2
  • AddNicToVirtualMachine 3
  • ListResourceLimits 10
  • CreateAffinityGroup 5
  • DisassociateIPAddress 1
  • ChangeServiceForVirtualMachine 3
  • StartVirtualMachine 3
  • ResetPasswordForVirtualMachine 3
  • ListSecurityGroups 11
  • AuthorizeSecurityGroupIngress 13
  • UpdateIPAddress 3
  • RevokeSecurityGroupIngress 1
  • ListVirtualMachines 29
  • DeleteInstanceGroup 5
  • UpdateVirtualMachine 12
  • AuthorizeSecurityGroupEgress 13
  • CreateSnapshot 1
  • ListVolumes 18
  • RebootVirtualMachine 1
  • DeleteSecurityGroup 6
  • RemoveNicFromVirtualMachine 2
  • AddIPToNic 2
  • ListServiceOfferings 1
  • RecoverVirtualMachine 2
  • RemoveIPFromNic 1
  • RevokeSecurityGroupEgress 1
  • UpdateDefaultNicForVirtualMachine 4
  • ListPublicIPAddresses 22
  • RestoreVirtualMachine 3
  • ResizeVolume 4
  • ListInstanceGroups 9
  • DeleteAffinityGroup 5
  • CreateSecurityGroup 5

read from input should ^C

Reading from the stdin should be cancelled by the global context.

% exo config
Good day! exo is already configured with accounts:
- cloudstack-testing [Default]
[+] Do you wish to add another account? [yN]: ^C^C^C^C^C

some examples for basic usage

Hi, could you share some basic examples of how to query for example running instances, fetch tags of them etc, something that could replace for example the python cs:

$ cs listVirtualMachines state=Running | jq

exo vm create to suggest doing a backup of the private key

% exo vm create huey \
            --cloud-init-file init.yml \
            --service-offering medium \
            --template "Ubuntu 16.04 LTS" \
            --security-group my-cluster

Creating sshkey
Deploying "huey".....

now

┼────────┼───────────────┼──────────────────────────────────────┼
│ NAME   │      IP       │                  ID                  │
┼────────┼───────────────┼──────────────────────────────────────┼
│ huey   │ 89.145.164.95 │ e724ad5a-4576-4203-a9ef-867806f5229a │
┼────────┼───────────────┼──────────────────────────────────────┼

idea

The deployment of "huey" went well! What to do now?

Connect to the machine

    > exo ssh huey
    ssh -i /home/me/.exoscale/.../id_rsa [email protected]

Put the SSH configuration into `.ssh/config`

    > exo ssh huey --info
    Host huey
        HostName ...
        ...

Tip of the day: you're the sole owner of the private key. Be cautious with it.
..

exo config show to hide the secret key

I would hide the secret key from the output, at least by default.

$ exo config show myorg
API KEY: EXO...
API Secret: ×××××××××××××××××××××××××××
...

exo vm delete a b c could work?

An attempt to delete many VMs stops at the first one, either successful or not.

% exo vm delete huey louie dewey
[+] sure you want to delete "huey" virtual machine [Yn]: y
Destroying....
9f0ea9d3-85e2-4068-a6e1-4ec967dd8904

% exo vm delete huey louie dewey
Unable to get Virtual Machine "huey". API error ParamError 431 (CSErrorCode(0) 0): not found, query: apikey=EXO9f5db99c785d5821b58627d1, command=listVirtualMachines, name=huey, response=json

%

exo k8s - SG parameter is ignored

exo create test-cluster --security-group k8s-security-group --firewall-rules-add

k8s-security-group is used to add rules but instances are created with "default" SG

exo config [RFC]

Ideas for the config.

Prerequisites

  • stop using `/.cloudstack.ini
  • use a new /.exoscale/config.toml

Ideas

First run

No cloudstack.ini detected.

$ exo config

Hi happy Exoscalian, some configuration is required to use exo

Do you have an account already? [Yn]
[No] -> quit, explain how to create one's account
[Yes]

We now need some very important informations, find them there.
https://portal.exoscale.com/account/profile/api

Endpoint: https://api.exoscale.ch/compute  # only on a retry
API Key:
Secret Key:

Testing the credentials...
[failure] -> go back to key/secret with the endpoint confirmation
[success]

Organization name [exoscale-2]
Make exoscale-2 your current profile? [Yn]

Do you have more credentials to import? [Yn]
[No] -> quit with a nice message
[Yes] -> go back to API Key/Secret

Some cloudstack.ini file were detected.

$ exo config

Howdy experienced Exoscalian, some configuration is required to use exo.

We've found the following configurations:
 - [cloudstack] EXO...
 - [prod] EXO...
 - [preprod:admin] EXO...

Do you wish to import them automagically? [All, some, none]
[None]  -> go to non-cloudstack.ini file setup
[All] -> like some but without the question
[Some]

Importing cloudstack EXO...? [Yn]
[No] -> skip
[Yes]

Organization name [exoscale-2]
Make exoscale-2 your current profile? [Yn]

...

Existing configuration is detected

$ exo config

Good day! exo is already configured with accounts:
- exoscale-2 [current]
- [email protected]
- ...

 Do you wish to add another account? [Yn]
[Yes] -> go to step 0
[No]

Bye bye!

Then runs

$ exo config list
[*] exoscale-2
   [email protected]
   [email protected]@ppapi.exoscale.com

$ exo config set [email protected]@ppapi.exoscale.com
Current profile set to [email protected]@ppapi.exoscale.com

$ exo config show [email protected]
API Key: EXO...
API Secret: <hidden>
Endpoint: ...

$ exo config remove [email protected]
[email protected]

Wins

  1. Move away from CloudStack
  2. A proper .toml may let us store way more informations than the current .ini file. (While becoming Terraform)
  3. ...
  4. 🤑

exo firewall add: panic: index out of range

% exo firewall add test -c 0.0.0.0/0 -p ALL                    
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/exoscale/egoscale/cmd/exo/cmd.glob..func14(0xb8ed60, 0xc4201a2050, 0x1, 0x5, 0x0, 0x0)
        /home/yoan/go/src/github.com/exoscale/egoscale/cmd/exo/cmd/firewall_add.go:120 +0xeec
github.com/exoscale/egoscale/cmd/exo/vendor/github.com/spf13/cobra.(*Command).execute(0xb8ed60, 0xc4201a2000, 0x5, 0x5, 0xb8ed60, 0xc4201a2000)
        /home/yoan/go/src/github.com/exoscale/egoscale/cmd/exo/vendor/github.com/spf13/cobra/command.go:762 +0x468
github.com/exoscale/egoscale/cmd/exo/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xb89a40, 0xc420167f00, 0x20, 0x7d7067)
        /home/yoan/go/src/github.com/exoscale/egoscale/cmd/exo/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/exoscale/egoscale/cmd/exo/vendor/github.com/spf13/cobra.(*Command).Execute(0xb89a40, 0x90c720, 0xc420072c60)
        /home/yoan/go/src/github.com/exoscale/egoscale/cmd/exo/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/exoscale/egoscale/cmd/exo/cmd.Execute()
        /home/yoan/go/src/github.com/exoscale/egoscale/cmd/exo/cmd/root.go:94 +0x16d
main.main()
        /home/yoan/exoscale/egoscale/cmd/exo/main.go:11 +0x2f

exo firewall remove --all says 0

% exo firewall remove my-cluster --all
[+] sure you want to delete all 0 firewall rules [yN]: y
13fb8b54-824a-432c-8b72-a99a3128df18
4a14f26c-a6b0-4042-a8aa-8e281a27acc2
e8521cd7-7851-4f89-b59f-590ac81ed422
7d22e6b2-0075-4b65-a4ee-682efbe2a1bc
78891d34-c586-45a9-8fd5-dcc32b2158cc

RFC: split compute and dns

With the upcoming vgo changes and the ever growing list of files you have to go through before reaching the README, it will be probably be the time to move packages files around.

  • github.com/exoscale/egoscale/cmd/cs
  • github.com/exoscale/egoscale/cmd/exo
  • new github.com/exoscale/egoscale/compute to contains all the cloudstack related files
  • new github.com/exoscale/egoscale/dns to contains all the dns related files
  • github.com/exoscale/egoscale will be empty

missing ssh keypair should be a warning for ssh --print

just like with the connection, it shouldn't fail on us and print something useful.

% exo ssh irc --print
default ssh KeyPair not found "Default ssh keypair not found" infos.sshKeys

% exo ssh irc        
Warning: Identity file Default ssh keypair not found not accessible: No such file or directory.
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-24-generic x86_64)
ubuntu@irc:~$

Add CSErrorCode

            ExceptionErrorCodeMap.put("com.cloud.utils.exception.CloudRuntimeException", 4250);
            ExceptionErrorCodeMap.put("com.cloud.utils.exception.ExecutionException", 4260);
            ExceptionErrorCodeMap.put("com.cloud.utils.exception.HypervisorVersionChangedException", 4265);
            ExceptionErrorCodeMap.put("com.cloud.exception.CloudException", 4275);
            ExceptionErrorCodeMap.put("com.cloud.exception.AccountLimitException", 4280);
            ExceptionErrorCodeMap.put("com.cloud.exception.AgentUnavailableException", 4285);
            ExceptionErrorCodeMap.put("com.cloud.exception.CloudAuthenticationException", 4290);
            ExceptionErrorCodeMap.put("com.cloud.exception.ConcurrentOperationException", 4300);
            ExceptionErrorCodeMap.put("com.cloud.exception.ConflictingNetworkSettingsException", 4305);
            ExceptionErrorCodeMap.put("com.cloud.exception.DiscoveredWithErrorException", 4310);
            ExceptionErrorCodeMap.put("com.cloud.exception.HAStateException", 4315);
            ExceptionErrorCodeMap.put("com.cloud.exception.InsufficientAddressCapacityException", 4320);
            ExceptionErrorCodeMap.put("com.cloud.exception.InsufficientCapacityException", 4325);
            ExceptionErrorCodeMap.put("com.cloud.exception.InsufficientNetworkCapacityException", 4330);
            ExceptionErrorCodeMap.put("com.cloud.exception.InsufficientServerCapacityException", 4335);
            ExceptionErrorCodeMap.put("com.cloud.exception.InsufficientStorageCapacityException", 4340);
            ExceptionErrorCodeMap.put("com.cloud.exception.InternalErrorException", 4345);
            ExceptionErrorCodeMap.put("com.cloud.exception.InvalidParameterValueException", 4350);
            ExceptionErrorCodeMap.put("com.cloud.exception.ManagementServerException", 4355);
            ExceptionErrorCodeMap.put("com.cloud.exception.NetworkRuleConflictException", 4360);
            ExceptionErrorCodeMap.put("com.cloud.exception.PermissionDeniedException", 4365);
            ExceptionErrorCodeMap.put("com.cloud.exception.ResourceAllocationException", 4370);
            ExceptionErrorCodeMap.put("com.cloud.exception.ResourceInUseException", 4375);
            ExceptionErrorCodeMap.put("com.cloud.exception.ResourceUnavailableException", 4380);
            ExceptionErrorCodeMap.put("com.cloud.exception.StorageUnavailableException", 4385);
            ExceptionErrorCodeMap.put("com.cloud.exception.UnsupportedServiceException", 4390);
            ExceptionErrorCodeMap.put("com.cloud.exception.VirtualMachineMigrationException", 4395);
            ExceptionErrorCodeMap.put("com.cloud.async.AsyncCommandQueued", 4540);
            ExceptionErrorCodeMap.put("com.cloud.exception.RequestLimitException", 4545);

            // Have a special error code for ServerApiException when it is
            // thrown in a standalone manner when failing to detect any of the above
            // standard exceptions.
            ExceptionErrorCodeMap.put("org.apache.cloudstack.api.ServerApiException", 9999);

generic Update

err := client.Update(&egoscale.Network{
    ID:          "1",
    Name:        "Hello",
    DisplayText: "This is a test",
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.