2024-01-04 09:57:21 +00:00
|
|
|
import { http, HttpResponse } from 'msw';
|
2022-02-01 17:38:45 +00:00
|
|
|
|
|
|
|
export const azureHandlers = [
|
2024-01-04 09:57:21 +00:00
|
|
|
http.get('/api/endpoints/:endpointId/azure/subscriptions', () =>
|
|
|
|
HttpResponse.json({
|
|
|
|
value: [
|
|
|
|
{
|
|
|
|
id: '/subscriptions/sub1',
|
|
|
|
authorizationSource: 'RoleBased',
|
|
|
|
subscriptionId: 'sub1',
|
|
|
|
displayName: 'Portainer',
|
|
|
|
state: 'Enabled',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})
|
|
|
|
),
|
|
|
|
http.get(
|
|
|
|
'/api/endpoints/:endpointId/azure/subscriptions/:subscriptionId/providers/Microsoft.ContainerInstance',
|
|
|
|
({ params }) =>
|
|
|
|
HttpResponse.json({
|
|
|
|
id: `/subscriptions/${params.subscriptionId}/providers/Microsoft.ContainerInstance`,
|
|
|
|
namespace: 'Microsoft.ContainerInstance',
|
|
|
|
resourceTypes: [
|
|
|
|
{
|
|
|
|
resourceType: 'containerGroups',
|
|
|
|
locations: [
|
|
|
|
'Australia East',
|
|
|
|
'Australia Southeast',
|
|
|
|
'Brazil South',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resourceType: 'serviceAssociationLinks',
|
|
|
|
locations: [
|
|
|
|
'Korea Central',
|
|
|
|
'North Central US',
|
|
|
|
'North Europe',
|
|
|
|
'Norway East',
|
|
|
|
'South Africa North',
|
|
|
|
'South Central US',
|
|
|
|
],
|
|
|
|
},
|
2022-02-01 17:38:45 +00:00
|
|
|
{
|
2024-01-04 09:57:21 +00:00
|
|
|
resourceType: 'locations',
|
|
|
|
locations: [],
|
2022-02-01 17:38:45 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})
|
|
|
|
),
|
2024-01-04 09:57:21 +00:00
|
|
|
http.get(
|
2022-02-01 17:38:45 +00:00
|
|
|
'/api/endpoints/:endpointId/azure/subscriptions/:subsriptionId/resourcegroups',
|
2024-01-04 09:57:21 +00:00
|
|
|
({ params }) =>
|
|
|
|
HttpResponse.json({
|
|
|
|
value: [
|
|
|
|
{
|
|
|
|
id: `/subscriptions/${params.subscriptionId}/resourceGroups/rg1`,
|
|
|
|
name: 'rg1',
|
|
|
|
location: 'southcentralus',
|
|
|
|
properties: { provisioningState: 'Succeeded' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: `/subscriptions/${params.subscriptionId}/resourceGroups/rg2`,
|
|
|
|
name: 'rg2',
|
|
|
|
location: 'southcentralus',
|
|
|
|
properties: { provisioningState: 'Succeeded' },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})
|
2022-02-01 17:38:45 +00:00
|
|
|
),
|
|
|
|
];
|