Skip to content
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

Add endpoint for cloud subnets #1019

Closed
wants to merge 1 commit into from
Closed

Conversation

lfu
Copy link
Member

@lfu lfu commented Mar 3, 2021

#1013

@miq-bot add_label enhancement, kasparov/no

@miq-bot
Copy link
Member

miq-bot commented Mar 3, 2021

Checked commit lfu@0e8c648 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint
2 files checked, 3 offenses detected

app/controllers/api/cloud_subnets_controller.rb

@lfu
Copy link
Member Author

lfu commented Mar 3, 2021

POST /api/cloud_subnets
{
         "action" : "create",
         "resource" : {
           "ems_id" : 10000000000013,
           "name"   : "test_cloud_subnet"
         }
}

{
    "results": [
        {
            "success": true,
            "message": "Creating Cloud Subnet test_cloud_subnet for Provider: OpenStack Network Manager",
            "task_id": "10000000053334",
            "task_href": "http://localhost:3000/api/tasks/10000000053334"
        }
    ]
}
POST /api/cloud_subnets/10000000000028
{
         "action": "edit",
         "status": "available"
}

{
    "success": true,
    "message": "Updating Cloud Subnet id: 10000000000028 name: 'provider'",
    "task_id": "10000000053335",
    "task_href": "http://localhost:3000/api/tasks/10000000053335"
}

@agrare
Copy link
Member

agrare commented Mar 29, 2021

ping @abellotti @bdunne

def create_resource(_type, _id = nil, data = {})
ems = ExtManagementSystem.find(data['ems_id'])
klass = CloudSubnet.class_by_ems(ems)
raise BadRequestError, "Create cloud subnet for Provider #{ems.name}: #{klass.unsupported_reason(:create)}" unless klass.supports?(:create)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be Cannot create cloud subnet ... same for the Update and Delete BadRequestError

@lfu lfu force-pushed the cloud_subnet_1013 branch from 0e8c648 to f9e9fc2 Compare March 29, 2021 20:29
@NickLaMuro
Copy link
Member

Closing in favor of #1025 (which fixes the tests that are failing here)

@NickLaMuro NickLaMuro closed this Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants