/** * Initializes a new instance of the MSICredentials. * * @param environment the Azure environment to use */ public MSICredentials(AzureEnvironment environment) { super(environment, null /** retrieving MSI token does not require tenant **/); this.resource = environment.managementEndpoint(); this.tokenSource = MSITokenSource.IMDS_ENDPOINT; }
@Override public List<ChildT> items() { return page.items(); } };
/** * Creates ChildListFlattener. * * @param parentList a paged list of parents * @param childListLoader {@link ChildListLoader} for fetching child paged list associated any parent */ ChildListFlattener(PagedList<ParentT> parentList, ChildListLoader<ParentT, ChildT> childListLoader) { this.parentItr = parentList.iterator(); this.childListLoader = childListLoader; }
/** * Gets the User-Agent header for the client. * * @return the user agent string. */ @Override public String userAgent() { return String.format("%s (%s, %s)", super.userAgent(), "SubscriptionClient", "2016-06-01"); } }
@Override public Page<V> nextPage(String nextPageLink) throws RestException, IOException { Page<U> uPage = uList.nextPage(nextPageLink); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink()); vPage.setItems(new ArrayList<V>()); loadConvertedList(uPage, vPage); return vPage; } };
@Override public Page<V> nextPage(String nextPageLink) throws RestException, IOException { Page<U> uPage = uList.nextPage(nextPageLink); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink()); vPage.setItems(new ArrayList<V>()); loadConvertedList(uPage, vPage); return vPage; } };
@Override public TopologyImpl withTargetSubnet(String subnetName) { parameters.withTargetSubnet(new SubResource().withId(parameters.targetVirtualNetwork().id() + "/subnets/" + subnetName)); return this; }
/** * Creates an instance from a list of resource groups. * * @param resourceGroupList the list of resource groups */ public GroupPagedList(PagedList<ResourceGroup> resourceGroupList) { this.resourceGroupItr = resourceGroupList.iterator(); setCurrentPage(nextPage("dummy")); }
@Override public Azure get() { try { return Azure.configure().withLogLevel(getLogLevel(logLevelStr)).authenticate(credentials).withDefaultSubscription(); } catch (CloudException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } }
@Path("/") @PermitAll public class Resource { @RolesAllowed("user") @GET public String get() { return "GET"; } @RolesAllowed("admin") @POST public String post(String content) { return content; } @Path("sub") public SubResource getSubResource() { return new SubResource(); } }
protected String baseUri() { if (this.baseUri != null) { return this.baseUri; } else { return AzureEnvironment.AZURE.url(AzureEnvironment.Endpoint.RESOURCE_MANAGER); } }
/** * Gets the User-Agent header for the client. * * @return the user agent string. */ @Override public String userAgent() { return String.format("%s (%s)", super.userAgent(), "PolicyClient"); } }
@Override public Page<V> nextPage(String nextPageLink) throws RestException, IOException { Page<U> uPage = uList.nextPage(nextPageLink); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink()); vPage.setItems(new ArrayList<V>()); loadConvertedList(uPage, vPage); return vPage; } };
@Override public List<ChildT> items() { return page.items(); } };
/** * Creates ChildListFlattener. * * @param parentList a paged list of parents * @param childListLoader {@link ChildListLoader} for fetching child paged list associated any parent */ ChildListFlattener(PagedList<ParentT> parentList, ChildListLoader<ParentT, ChildT> childListLoader) { this.parentItr = parentList.iterator(); this.childListLoader = childListLoader; }
/** * Gets the User-Agent header for the client. * * @return the user agent string. */ @Override public String userAgent() { return String.format("%s (%s, %s)", super.userAgent(), "FeatureClient", "2015-12-01"); } }