Comments (3)
Server also as a bunch of more attributes:
- id
- created
- image
- server_type
- datacenter
- included_traffic
- ingoing_traffic
- outgoing_traffic
- locked
- name
- primary_disk_size
- rescue_enabled
- status
- backup_window
- iso
- labels (currently hash)
- load_balancers (currently array)
- placement_group
- private_net (currently array)
- protection (
{"delete"=>false, "rebuild"=>false}
) - public_net (currently hash)
- volumes (currently list)
At least load_balancers
, private_net
, public_net
and volumes
are collections of resources. The schema
defined in entry_loader.rb
maps the api response to objects, can't handle collections AFAIK. Either we extend the schema, create a collection resource for each one (VolumesCollection
containing Volume
objects) or create a generic Collection than can be initialized with the wanted resource schema(volumes: Collection(Volume))
.
from hcloud-ruby.
Went through the API docs and the code and found the following missing actions:
- Network
- change_ip_range
- Server
- Get metrics
- add_to_placement_group
- change_alias_ips
- change_dns_ptr
- remove_from_placement_group
The following attributes on existing actions are missing
- Firewall
labels
on update
- Floating IPs
name
on createname
,labels
on update
- Image
status
,include_deprecated
on get alllabels
on update
- Network
labels
on update
- Placement Groups
label_selector
on get alllabels
on update
- Server
automount
,firewalls
,placement_group
,public_net
,volumes
on createlabels
on update
- SSH key
fingerprint
on get alllabels
on update
- Volume
status
on get alllabels
on update
from hcloud-ruby.
It's probably good that the labels
fields on :updatable
are missing. I just checked what this does, because update(labels: {'foo': 'bar'})
works without problems. :updatable
creates attr=
methods, so fields can be changed with obj.name = 'new-name'
. The changes can then be persisted using obj.save
:
obj = client.load_balancers['old-name']
obj.name = 'new-name'
obj.save
# besides: call to save is currently broken, so nobody uses this feature
# alternative (which works):
obj.update({ name: 'new-name' })
For labels being a hash this does not work as expected (at least as I as a user would want to use it). The following code does not save the new label to the Cloud API.
obj = client.load_balancers['old-name']
obj.labels.merge({ 'label' => 'value' })
obj.save
tl;dr: I think we'll have to think a bit more about :updatable
to make it work with objects (like hashes) that can be changed in other ways than assignments.
from hcloud-ruby.
Related Issues (20)
- [Dependencies] Unpin activesupport HOT 1
- [Feature] Add missing Resources/Endpoints Q1/2022 HOT 1
- [Feature] Add Firewalls HOT 1
- [Feature] Add Certificates
- [Feature] Add PlacementGroups HOT 1
- [Feature] Add Pricing
- [Feature] Add LoadBalancers and -Types
- [CI] Build + Push to mirror
- Doubles tests failure with seed 50938 HOT 1
- [Bug] IPv6 global address is not parsed correctly
- [Bug] Firewalls do not expose actions
- [Feature] Add Primary IPs HOT 2
- [Feature] Add Primary IPs HOT 1
- [CI] Change fake service tests to integration tests
- [Enhancement] Make Typhoeus call check more natural to read
- CI-Adjustments to allow manual triggers
- question: could you point out the differences to other hcloud gem? HOT 2
- ARM64 Support
- 1.2.0 release raises `undefined method 'blank?'` errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hcloud-ruby.