-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding new IBM Cloud-Object-Storage provider #159
Conversation
@agrare Hey, Adam. We're starting our work on the IBM Cloud-Object-Storage provider, which will display cloud-buckets and objects in those cloud-buckets within MIQ. Only thing is, the registration of standalone Object-Providers in MIQ is disabled in UI as of now. |
Here the build seems to fail due to a ruby version. |
That should have been fixed by #160 |
app/models/manageiq/providers/ibm_cloud/cloud_object_storage/storage_manager.rb
Outdated
Show resolved
Hide resolved
app/models/manageiq/providers/ibm_cloud/cloud_object_storage/storage_manager.rb
Outdated
Show resolved
Hide resolved
app/models/manageiq/providers/ibm_cloud/cloud_object_storage/storage_manager.rb
Outdated
Show resolved
Hide resolved
app/models/manageiq/providers/ibm_cloud/cloud_object_storage/storage_manager/event_catcher.rb
Outdated
Show resolved
Hide resolved
app/models/manageiq/providers/ibm_cloud/cloud_object_storage/storage_manager/metrics_capture.rb
Outdated
Show resolved
Hide resolved
app/models/manageiq/providers/ibm_cloud/cloud_object_storage/storage_manager/refresh_worker.rb
Outdated
Show resolved
Hide resolved
@agrare I incorporated your suggestions. |
This is looking good, just needs params_for_create, verify_credentials, and raw_connect at the class level, and verify_credentials, connect at the instance level. We don't need to do refresh for the first PR as long as we can add the provider and it verifies credentials properly |
@jaywcarman Do you know if COS has an OpenAPI description so that we can generate the corresp. SDK/API gem for this an future tasks? |
Yes, the download button on the COS API docs page is not easy to find: Direct link to the openapi def json: We'll need to work with the IBM SDK generation team. |
@jaywcarman Thanks! That's really cool. I guess we'd have to first do that before we implement connect and other methods. We'll discuss further in Slack. |
I added the same structure for COS provider as for VPC and PVS wrt. to the inventory. I've also added the params_for_create implementation. |
I've added the connect and verify_credentials methods, using IAM and S3 API for that. Validation of GUID pending. |
@agrare Is this a legit build error? I can't understand from the logs. |
@agrare oh, probably missing value in the settings.yaml |
def self.verify_bearer(region, endpoint, access_key, secret_key) | ||
begin | ||
raw_connect(region, endpoint, access_key, secret_key).list_buckets({}, :params => {:max_keys => 1}) | ||
rescue Aws::Errors::ServiceError, Seahorse::Client::NetworkingError => err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we really expecting AWS exceptions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, IBM Cloud Object Storage uses an S3 compatible API so @iv1111 is using the Aws::S3
gem: https://github.com/ManageIQ/manageiq-providers-ibm_cloud/pull/159/files#diff-ffe546bf7942848309735f1742f214e4af3c09c6bbacdf3ef0d1277981902b02R197-R209
31fc428
to
e6f030f
Compare
- this manager implements connection to the IBM Cloud-Object-Storage, for information see: https://www.ibm.com/cloud/object-storage - implemented 'buckets' and 'object' listing in th the collector - added 'connect' and 'verify_credentials' implementation - added corresp. systemd files - parser showing buckets: name, size, obj. count - parser showing objects: name, size, date
The systemd unit files and contents need to use 'object_manager' for 'ManageIQ::Providers::IbmCloud::ObjectStorage::ObjectManager'.
Add secrets/credential configuration in preparation for refresh specs.
Secrets config should be kept local and not committed.
A default 'Endpoint' object is created in the COS ems 'endpoints' attribute when the ems object is created. The '<<' operator will append an _additional_ endpoint to the 'endpoints' list. Setting the url in the default endpoint should be done through the 'FactorBot.create()' call to create the COS ems object, so there is only one default endpoint with the url set in this commit.
e6f030f
to
4ac8b10
Compare
Checked commits iv1111/manageiq-providers-ibm_cloud@c72b1b4~...4ac8b10 with ruby 2.6.3, rubocop 1.13.0, haml-lint 0.35.0, and yamllint |
ManageIQ/manageiq-ui-classic#7675 is now implemented, allowing the addition of standalone object storage managers |
We can fix any of these remaining issues in follow-up PRs, I'm going to assign to @jaywcarman for final review / merge since I have some commits in this branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and everything is functional. I agree with @agrare's suggestion we address the remaining issues as follow-up PRs.
this manager will implement a connection to the
IBM Cloud-Object-Storage, for information see:
https://www.ibm.com/cloud/object-storage
adding skeleton code, currently working on
the 'parse' and related methods
Depends on: ManageIQ/manageiq-ui-classic#7675