(diskName, zone, projectId)
| 31 | const zoneOperationsClient = new computeLib.ZoneOperationsClient(); |
| 32 | |
| 33 | async function createDisk(diskName, zone, projectId) { |
| 34 | const [response] = await disksClient.insert({ |
| 35 | project: projectId, |
| 36 | zone, |
| 37 | diskResource: { |
| 38 | sizeGb: 10, |
| 39 | name: diskName, |
| 40 | zone, |
| 41 | type: `zones/${zone}/diskTypes/pd-balanced`, |
| 42 | }, |
| 43 | }); |
| 44 | |
| 45 | let operation = response.latestResponse; |
| 46 | |
| 47 | // Wait for the create disk operation to complete. |
| 48 | while (operation.status !== 'DONE') { |
| 49 | [operation] = await zoneOperationsClient.wait({ |
| 50 | operation: operation.name, |
| 51 | project: projectId, |
| 52 | zone: operation.zone.split('/').pop(), |
| 53 | }); |
| 54 | } |
| 55 | |
| 56 | console.log(`Disk: ${diskName} created.`); |
| 57 | } |
| 58 | describe('Consistency group', async () => { |
| 59 | const consistencyGroupName = `consistency-group-name-${uuid.v4()}`; |
| 60 | const prefix = 'disk-name'; |
no outgoing calls
no test coverage detected