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

[AutoPR @azure/arm-policyinsights] Bgp apipa changes #635

Open
wants to merge 1 commit into
base: sdkAutomation/@azure_arm-policyinsights
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/policyinsights/arm-policyinsights/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
103 changes: 103 additions & 0 deletions sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as Models from "../models";
import * as Mappers from "../models/policyStatesMappers";
import * as Parameters from "../models/parameters";
Expand Down Expand Up @@ -298,6 +299,29 @@ export class PolicyStates {
callback) as Promise<Models.PolicyStatesSummarizeForResourceResponse>;
}

/**
* Triggers a policy evaluation scan for all the resources under the subscription
* @param subscriptionId Microsoft Azure subscription ID.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
*/
triggerSubscriptionEvaluation(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
return this.beginTriggerSubscriptionEvaluation(subscriptionId,options)
.then(lroPoller => lroPoller.pollUntilFinished());
}

/**
* Triggers a policy evaluation scan for all the resources under the resource group.
* @param subscriptionId Microsoft Azure subscription ID.
* @param resourceGroupName Resource group name.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
*/
triggerResourceGroupEvaluation(subscriptionId: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
return this.beginTriggerResourceGroupEvaluation(subscriptionId,resourceGroupName,options)
.then(lroPoller => lroPoller.pollUntilFinished());
}

/**
* Queries policy states for the subscription level policy set definition.
* @param policyStatesResource The virtual resource under PolicyStates resource type. In a given
Expand Down Expand Up @@ -603,6 +627,40 @@ export class PolicyStates {
summarizeForResourceGroupLevelPolicyAssignmentOperationSpec,
callback) as Promise<Models.PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse>;
}

/**
* Triggers a policy evaluation scan for all the resources under the subscription
* @param subscriptionId Microsoft Azure subscription ID.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginTriggerSubscriptionEvaluation(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
subscriptionId,
options
},
beginTriggerSubscriptionEvaluationOperationSpec,
options);
}

/**
* Triggers a policy evaluation scan for all the resources under the resource group.
* @param subscriptionId Microsoft Azure subscription ID.
* @param resourceGroupName Resource group name.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginTriggerResourceGroupEvaluation(subscriptionId: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
subscriptionId,
resourceGroupName,
options
},
beginTriggerResourceGroupEvaluationOperationSpec,
options);
}
}

// Operation Specifications
Expand Down Expand Up @@ -1101,3 +1159,48 @@ const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: msRest.Operat
},
serializer
};

const beginTriggerSubscriptionEvaluationOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation",
urlParameters: [
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion3
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {},
202: {},
default: {
bodyMapper: Mappers.QueryFailure
}
},
serializer
};

const beginTriggerResourceGroupEvaluationOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName
],
queryParameters: [
Parameters.apiVersion3
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {},
202: {},
default: {
bodyMapper: Mappers.QueryFailure
}
},
serializer
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class PolicyInsightsClientContext extends msRestAzure.AzureServiceClient
if (!options) {
options = {};
}
if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
Expand All @@ -44,10 +44,10 @@ export class PolicyInsightsClientContext extends msRestAzure.AzureServiceClient
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down