const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rules: [
{
priority: 123,
protocol: '<string>',
source: '<string>',
destination: '<string>',
ports: '<string>'
}
],
networkId: '<string>'
})
};
fetch('https://api.example.com/v1/regions/{region}/compute/firewalls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));