akamai / NetStorageKit-Node

Akamai NetStorage API for Node
Apache License 2.0
20 stars 15 forks source link

Unable to rename directories #22

Open sespinoza-dev opened 2 years ago

sespinoza-dev commented 2 years ago

I'm unable to rename directories.

The current documentation says it's possible to rename both directories and files.

const NETSTORAGE_TARGET = '/<cpcode>/temp_test/v0'
const NETSTORAGE_DESTINATION = '/<cpcode>/temp_test/v1'
console.log('source', NETSTORAGE_TARGET)
console.log('target', NETSTORAGE_DESTINATION)

ns.rename(NETSTORAGE_TARGET, NETSTORAGE_DESTINATION, (err, response, body) => {
  if (err) {
    console.error('err', err)
    throw err
  }
  console.log('err', err)

  console.log('statusCode: ', response.statusCode)
  console.log('statusMessage: ', response.statusMessage)
  console.log('body ', body)
})

logs

source /<cpcode>/temp_test/v0
target /<cpcode>/temp_test/v1
err null
statusCode:  404
statusMessage:  Not Found
body  { message: 'Source not found' }

I'll appreciate any help, Cheers.