Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Export Policy and File operation changes NAS Storage pool creation#11
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you 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 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.cloudstack.storage.feign; | ||
| import feign.Feign; | ||
| public class FeignClientFactory { | ||
| private final FeignConfiguration feignConfiguration; | ||
| public FeignClientFactory() { | ||
| this.feignConfiguration = new FeignConfiguration(); | ||
| } | ||
| public FeignClientFactory(FeignConfiguration feignConfiguration) { | ||
| this.feignConfiguration = feignConfiguration; | ||
| } | ||
| public <T> T createClient(Class<T> clientClass) { | ||
| return Feign.builder() | ||
| .client(feignConfiguration.createClient()) | ||
| .encoder(feignConfiguration.createEncoder()) | ||
| .decoder(feignConfiguration.createDecoder()) | ||
| // .logger(feignConfiguration.createLogger()) | ||
| .retryer(feignConfiguration.createRetryer()) | ||
| .requestInterceptor(feignConfiguration.createRequestInterceptor()) | ||
| .target(clientClass, "https://10.196.38.171/"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets not merge such changes, you can do this for internal testing. | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -20,26 +20,19 @@ | ||
| package org.apache.cloudstack.storage.feign.client; | ||
| import org.apache.cloudstack.storage.feign.model.Aggregate; | ||
| import org.apache.cloudstack.storage.feign.FeignConfiguration; | ||
| import org.apache.cloudstack.storage.feign.model.response.OntapResponse; | ||
| import org.springframework.cloud.openfeign.FeignClient; | ||
| import org.springframework.context.annotation.Lazy; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.RequestHeader; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestMethod; | ||
| import feign.Headers; | ||
| import feign.Param; | ||
| import feign.RequestLine; | ||
| import java.net.URI; | ||
| @Lazy | ||
| @FeignClient(name="AggregateClient", url="https://{clusterIP}/api/storage/aggregates", configuration = FeignConfiguration.class) | ||
| public interface AggregateFeignClient { | ||
| //this method to get all aggregates and also filtered aggregates based on query params as a part of URL | ||
| @RequestMapping(method=RequestMethod.GET) | ||
| OntapResponse<Aggregate> getAggregateResponse(URI baseURL, @RequestHeader("Authorization") String header); | ||
| @RequestMapping(method=RequestMethod.GET, value="/{uuid}") | ||
| Aggregate getAggregateByUUID(URI baseURL,@RequestHeader("Authorization") String header, @PathVariable(name = "uuid", required = true) String uuid); | ||
| @RequestLine("GET /") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add url | ||
| @Headers("Authorization: {authHeader}") | ||
| OntapResponse<Aggregate> getAggregateResponse(@Param("baseURL") URI baseURL, @Param("authHeader") String authHeader); | ||
| @RequestLine("GET /{uuid}") | ||
| @Headers("Authorization: {authHeader}") | ||
| Aggregate getAggregateByUUID(@Param("baseURL") URI baseURL, @Param("authHeader") String authHeader, @Param("uuid") String uuid); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
CopilotAINov 4, 2025
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.
Hardcoded base URL in FeignClientFactory should be configurable to support different environments.